aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorKung Hsu <kung@cygnus>1994-03-15 19:45:04 +0000
committerKung Hsu <kung@cygnus>1994-03-15 19:45:04 +0000
commitb427690aacc1147cbf232d2b167e86f83aa88017 (patch)
tree31239db0262508440993af220f8e33de75f6fe13 /gdb/c-exp.y
parente7b02f0e4943674ca63c44d84b8607687b0e741e (diff)
downloadgdb-b427690aacc1147cbf232d2b167e86f83aa88017.zip
gdb-b427690aacc1147cbf232d2b167e86f83aa88017.tar.gz
gdb-b427690aacc1147cbf232d2b167e86f83aa88017.tar.bz2
Modified Files:
ChangeLog c-exp.y * c-exp.y(yylex): fix potential memory overflow.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 62ecbb0..d559c11 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';