Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Fix possible buffer overflow bug in x86_64-tdep.c
@ 2003-07-13 16:32 Mark Kettenis
  2003-07-14  8:55 ` Andreas Jaeger
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2003-07-13 16:32 UTC (permalink / raw)
  To: gdb-patches

The attached fixes a possible buffer overflow in
x86_64_store_return_value().

(Andreas, this was the bug I mentioned to you yesterday).

Andreas forgot to check in his origional patch on the 6.0 release
branch.  I'll do so shortly with this fix included.

Checked in.

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>
 
	* x86-64-tdep.c (x86_64_store_return_value): Use an intermediate
	buffer when storing double and float varibles into %xmm0.

Index: x86-64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/x86-64-tdep.c,v
retrieving revision 1.82
diff -u -p -r1.82 x86-64-tdep.c
--- x86-64-tdep.c 9 Jul 2003 22:10:58 -0000 1.82
+++ x86-64-tdep.c 13 Jul 2003 16:28:14 -0000
@@ -788,7 +788,7 @@ 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, buf);
     }
   /* XXX: What about complex floating point types?  */
   else


^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: [PATCH] Fix possible buffer overflow bug in x86_64-tdep.c
@ 2003-07-13 22:09 Mark Kettenis
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Kettenis @ 2003-07-13 22:09 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-14 19:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-13 16:32 [PATCH] Fix possible buffer overflow bug in x86_64-tdep.c Mark Kettenis
2003-07-14  8:55 ` Andreas Jaeger
2003-07-14 19:25   ` Mark Kettenis
2003-07-13 22:09 Mark Kettenis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox