This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
FYI: Java: make_local_function_alias buffer size
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: java-patches at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Aug 2004 10:32:16 -0400
- Subject: 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);