This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: Java: make_local_function_alias buffer size


Thomas Neumann pointed out that make_local_function_alias() had a buffer overrun - I didn't allocate space for the extra 'L' character when allocating the 'name' buffer. I'm checking in this patch as obvious.

Bryce

2004-08-19 Bryce McKinlay <mckinlay@redhat.com>

   * class.c (make_local_function_alias): Allocate extra space for 'L'
   in name buffer. Reported by Thomas Neumann.

--- class.c 19 Aug 2004 03:09:45 -0000 1.204
+++ class.c 19 Aug 2004 14:30:07 -0000
@@ -1210,7 +1210,7 @@
#ifdef ASM_OUTPUT_DEF
tree alias;
const char *method_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (method));
- char *name = alloca (strlen (method_name) + 1);
+ char *name = alloca (strlen (method_name) + 2);
char *buf = alloca (strlen (method_name) + 128);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]