Bug 12235 - elfedit.c:716: error: array subscript is above array bounds
Summary: elfedit.c:716: error: array subscript is above array bounds
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL: http://sourceware.org/ml/binutils/201...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-18 21:50 UTC by John
Modified: 2010-11-22 03:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
Project(s) to access:
ssh public key:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2010-11-18 21:50:06 UTC
binutils: 2.21.51

Platform:
AIX 3 5 000D1D5A4C00
powerpc-ibm-aix5.3.0.0

gcc version 4.3.3 (GCC) 

This is a re-introduction of a bug that was fixed in Bug 11742 - readelf.c: get_archive_member_name(): array subscript is above array bounds.  The same patch works in this new file.

gcc -DHAVE_CONFIG_H -I.  -I. -I. -I../bfd -I./../bfd -I./../include -I./../intl -DLOCALEDIR="\"/mtg/tool/binutils-2.21.51/share/locale\"" -Dbin_dummy_emulation=bin_aix5_emulation -I/mtg/tool/gmp-5.0.1/powerpc-AIX5.3/include -I/mtg/tool/mpfr-3.0.0/include -I/mtg/tool/mpc-0.8.2/include -I/mtg/tool/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -O3 -pipe -MT elfedit.o -MD -MP -MF .deps/elfedit.Tpo -c -o elfedit.o elfedit.c
cc1: warnings being treated as errors
elfedit.c: In function 'get_archive_member_name':
elfedit.c:716: error: array subscript is above array bounds
Comment 1 Alan Modra 2010-11-18 23:11:24 UTC
Rather than patching elfedit.c, functions common to readelf.c and elfedit.c should be extracted to a new file.
Comment 2 H.J. Lu 2010-11-21 17:15:58 UTC
A patch is posted at

http://sourceware.org/ml/binutils/2010-11/msg00385.html
Comment 3 H.J. Lu 2010-11-22 03:24:15 UTC
Fixed