This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: Fix off by one array length error in tc-mcore.c
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Fri, 22 Aug 2008 18:04:17 +0100
- Subject: PATCH: Fix off by one array length error in tc-mcore.c
Hi Guys,
I am checking in the patch below to fix an off-by-one error reported
by gcc 4.3.0 when compiling tc-mcore.c:
gas/config/tc-mcore.c: In function 'md_assemble':
gas/config/tc-mcore.c:877: error: array subscript is above array bounds
Cheers
Nick
gas/ChangeLog
2008-08-22 Nick Clifton <nickc@redhat.com>
* config/tc-mcore.c (md_assemble): Increase length of name array
to include terminating NUL.
Index: gas/config/tc-mcore.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mcore.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 tc-mcore.c
*** gas/config/tc-mcore.c 17 Oct 2007 16:45:55 -0000 1.45
--- gas/config/tc-mcore.c 22 Aug 2008 17:03:32 -0000
*************** md_assemble (char * str)
*** 859,865 ****
unsigned off;
unsigned isize;
expressionS e;
! char name[20];
/* Drop leading whitespace. */
while (ISSPACE (* str))
--- 859,865 ----
unsigned off;
unsigned isize;
expressionS e;
! char name[21];
/* Drop leading whitespace. */
while (ISSPACE (* str))