From: Nick Clifton Date: Fri, 12 Nov 1999 11:02:56 +0000 (+0000) Subject: do not look beyond the end of the buffer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=035349a40dd7d6fde2cb6176dcf229a09f9087b3;p=binutils-gdb.git do not look beyond the end of the buffer --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 62002ebcc90..72f3ab3fb0f 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +1999-11-12 Nick Clifton + + * macro.c (buffer_and_nest): Do not check beyond the end of the + buffer. + 1999-11-11 Nick Clifton * macro.c (buffer_and_nest): Look for seperator after TO and diff --git a/gas/macro.c b/gas/macro.c index 2ef4cb400f8..1c33de3a229 100644 --- a/gas/macro.c +++ b/gas/macro.c @@ -246,10 +246,10 @@ buffer_and_nest (from, to, ptr, get_line) if (ptr->ptr[i] == '.') i++; if (strncasecmp (ptr->ptr + i, from, from_len) == 0 - && ! isalnum (ptr->ptr[i + from_len])) + && (ptr->len == (i + from_len || ! isalnum (ptr->ptr[i + from_len])))) depth++; if (strncasecmp (ptr->ptr + i, to, to_len) == 0 - && ! isalnum (ptr->ptr[i + to_len])) + && (ptr->len == (i + to_len) || ! isalnum (ptr->ptr[i + to_len]))) { depth--; if (depth == 0)