This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Fix possible buffer overflow bug in x86_64-tdep.c
- From: Mark Kettenis <kettenis at chello dot nl>
- To: gdb-patches at sources dot redhat dot com
- Date: Sun, 13 Jul 2003 18:31:46 +0200 (CEST)
- Subject: [PATCH] Fix possible buffer overflow bug in x86_64-tdep.c
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