This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: sparc-tdep.c: __builtin___memcpy_chk overflows destination buffer
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: ralf dot corsepius at rtems dot org, gdb-patches at sourceware dot org, Joel dot Sherrill at oarcorp dot com
- Date: Thu, 17 Sep 2009 08:43:35 -0700
- Subject: Re: sparc-tdep.c: __builtin___memcpy_chk overflows destination buffer
- References: <4AB1A090.8030701@rtems.org> <200909170624.n8H6OkDh021445@brahms.sibelius.xs4all.nl>
> You sent the diff as bas64 encoded MIME attachment which makes it
> difficult for me to review your diff. Can you send it inline or as a
> normal 7-bit ASCII encoded attachments?
Here is the patch. I don't really understand what the problem is,
however, and I'm quite hesitant about this patch. I wasn't able to
reproduce the build failure, so couldn't investigate any further.
2009-09-17 Ralf Corsépius <ralf.corsepius@rtems.org>
* sparc-tdep.c (sparc32_store_return_value): Use size_t as
return type of TYPE_LENGTH(type).
diff -Naur gdb-6.8.91.orig/gdb/sparc-tdep.c gdb-6.8.91/gdb/sparc-tdep.c
--- gdb-6.8.91.orig/gdb/sparc-tdep.c 2009-09-07 19:52:41.000000000 +0200
+++ gdb-6.8.91/gdb/sparc-tdep.c 2009-09-17 03:43:48.000000000 +0200
@@ -1100,7 +1100,7 @@
sparc32_store_return_value (struct type *type, struct regcache *regcache,
const gdb_byte *valbuf)
{
- int len = TYPE_LENGTH (type);
+ size_t len = TYPE_LENGTH (type);
gdb_byte buf[8];
gdb_assert (!sparc_structure_or_union_p (type));
--
Joel