[PATCH] Fix possible buffer overflow bug in x86_64-tdep.c

Mark Kettenis kettenis@chello.nl
Sun Jul 13 22:09:00 GMT 2003


I made a real mess of this.  Wrong code, wrong ChangeLog, fix with
empty log message.  Fixed things now and checked it in on the branch.
Here's what I checked in on the branch.  This is effectively what I
have checked in on mainline too.

Mark

Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* x86-64-tdep.c (x86_64_store_return_value): Use
	regcache_cooked_write_part instead of regcache_cooked_write.

Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.79.2.2
diff -u -p -r1.79.2.2 x86-64-tdep.c
--- x86-64-tdep.c 2 Jul 2003 07:46:40 -0000 1.79.2.2
+++ x86-64-tdep.c 13 Jul 2003 22:01:08 -0000
@@ -799,7 +799,8 @@ x86_64_store_return_value (struct type *
   else if (TYPE_CODE_FLT == TYPE_CODE (type))
     {
       /* Handle double and float variables.  */
-      regcache_cooked_write (regcache,  X86_64_XMM0_REGNUM, valbuf);
+      regcache_cooked_write_part (regcache, X86_64_XMM0_REGNUM,
+				  0, len, valbuf);
     }
   /* XXX: What about complex floating point types?  */
   else



More information about the Gdb-patches mailing list