summaryrefslogtreecommitdiff
path: root/gas/macro.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-11-12 11:02:56 +0000
committerNick Clifton <nickc@redhat.com>1999-11-12 11:02:56 +0000
commit5ffda43d18440a4735a9f469521ab31304702af1 (patch)
tree698ff1754d814deb296052ad6c494b7f71ffb0b1 /gas/macro.c
parentd1eb3997a3ceffd13c6d2c5ab7fde99c2ee89a59 (diff)
downloadbinutils-redhat-5ffda43d18440a4735a9f469521ab31304702af1.tar.gz
do not look beyond the end of the buffer
Diffstat (limited to 'gas/macro.c')
-rw-r--r--gas/macro.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gas/macro.c b/gas/macro.c
index 2ef4cb400f..1c33de3a22 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)