* method.c (make_thunk): Avoid name buffer overflow.

From-SVN: r17784
This commit is contained in:
Scott Snyder 1998-02-08 15:46:23 -07:00 committed by Jeff Law
parent 13309a5ff9
commit aea955a2df
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Sun Feb 8 23:47:38 1998 scott snyder <sss@d0linux01.fnal.gov>
* method.c (make_thunk): Avoid name buffer overflow.
Sat Feb 7 16:48:54 1998 Jason Merrill <jason@yorick.cygnus.com>
* pt.c (instantiate_decl): Call cp_finish_decl for vars even if we

View File

@ -1905,7 +1905,7 @@ make_thunk (function, delta)
tree function;
int delta;
{
char buffer[250];
char *buffer;
tree thunk_id;
tree thunk;
char *func_name;
@ -1916,6 +1916,7 @@ make_thunk (function, delta)
if (TREE_CODE (func_decl) != FUNCTION_DECL)
abort ();
func_name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (func_decl));
buffer = (char *)alloca (strlen (func_name) + 32);
if (delta<=0)
sprintf (buffer, "__thunk_%d_%s", -delta, func_name);
else