From: Keith Seitz Date: Wed, 14 Mar 2001 18:36:45 +0000 (+0000) Subject: * linespec.c (decode_line_1): Skip argptr over a leading X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91c1720e680c679cbfd6314e72bd6ba2b383e31f;p=binutils-gdb.git * linespec.c (decode_line_1): Skip argptr over a leading double quote. Prevents alloc of 0 bytes and memcpy of -1 bytes. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fc5477c371f..a4e0c146b2d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-03-14 Keith Seitz + + * linespec.c (decode_line_1): Skip argptr over a leading + double quote. Prevents alloc of 0 bytes and memcpy of -1 bytes. + 2001-03-14 Kevin Buettner * config/djgpp/fnchange.lst (ia64-aix-nat.c): Add entry. diff --git a/gdb/linespec.c b/gdb/linespec.c index 266ac6dba77..3f790cc49c4 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -612,10 +612,10 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, s = NULL; p = *argptr; - if (p[0] == '"') + if (**argptr == '"') { is_quote_enclosed = 1; - p++; + (*argptr)++; } else is_quote_enclosed = 0;