From b427690aacc1147cbf232d2b167e86f83aa88017 Mon Sep 17 00:00:00 2001 From: Kung Hsu Date: Tue, 15 Mar 1994 19:45:04 +0000 Subject: [PATCH] Modified Files: ChangeLog c-exp.y * c-exp.y(yylex): fix potential memory overflow. --- gdb/ChangeLog | 4 ++++ gdb/c-exp.y | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3eea40123c..09130931fb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +Tue Mar 15 11:40:43 1994 Kung Hsu (kung@mexican.cygnus.com) + + * c-exp.y(yylex): fix potential memory overflow. + Tue Mar 15 10:33:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com) * environ.c (set_in_environ): Eliminate special handling of PATH and diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 62ecbb0f6a..d559c115d0 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1573,7 +1573,7 @@ yylex () struct symbol *cur_sym; /* As big as the whole rest of the expression, which is at least big enough. */ - char *tmp = alloca (strlen (namestart)); + char *tmp = alloca (strlen (namestart)+1); memcpy (tmp, namestart, p - namestart); tmp[p - namestart] = '\0';