This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Fix to previous patch to macro.c
- To: binutils at sourceware dot cygnus dot com
- Subject: Fix to previous patch to macro.c
- From: Nick Clifton <nickc at cygnus dot com>
- Date: Fri, 12 Nov 1999 11:01:59 GMT
Hi Guys,
I have checked in the patch below to fix my change to macro.c that I
made yesterday. I forgot to check the length of the buffer, and to
make sure that I was not looking beyond the end of the buffer.
Cheers
Nick
1999-11-12 Nick Clifton <nickc@cygnus.com>
* macro.c (buffer_and_nest): Do not check beyond the end of the
buffer.
Index: macro.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gas/macro.c,v
retrieving revision 1.26
diff -p -r1.26 macro.c
*** macro.c 1999/11/11 08:36:40 1.26
--- macro.c 1999/11/12 10:58:47
*************** buffer_and_nest (from, to, ptr, get_line
*** 246,255 ****
if (ptr->ptr[i] == '.')
i++;
if (strncasecmp (ptr->ptr + i, from, from_len) == 0
! && ! isalnum (ptr->ptr[i + from_len]))
depth++;
if (strncasecmp (ptr->ptr + i, to, to_len) == 0
! && ! isalnum (ptr->ptr[i + to_len]))
{
depth--;
if (depth == 0)
--- 246,255 ----
if (ptr->ptr[i] == '.')
i++;
if (strncasecmp (ptr->ptr + i, from, from_len) == 0
! && (ptr->len == (i + from_len || ! isalnum (ptr->ptr[i + from_len]))))
depth++;
if (strncasecmp (ptr->ptr + i, to, to_len) == 0
! && (ptr->len == (i + to_len) || ! isalnum (ptr->ptr[i + to_len])))
{
depth--;
if (depth == 0)