aboutsummaryrefslogtreecommitdiff
path: root/binutils/readelf.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-08-12 13:11:11 +0000
committerNick Clifton <nickc@redhat.com>2010-08-12 13:11:11 +0000
commit2e49a6d0109e0e3f88aac9202b5331fe251c7b01 (patch)
tree5e9b15520be3777becb23e4746102ef767a7b896 /binutils/readelf.c
parent51adeb0f12ef298f9f7dcbd4f7c2d13fe4a695a0 (diff)
downloadgdb-2e49a6d0109e0e3f88aac9202b5331fe251c7b01.zip
gdb-2e49a6d0109e0e3f88aac9202b5331fe251c7b01.tar.gz
gdb-2e49a6d0109e0e3f88aac9202b5331fe251c7b01.tar.bz2
PR binutils/11742
* readelf.c (get_archive_member_name): Do not read beyond the end of the ar_name field.
Diffstat (limited to 'binutils/readelf.c')
-rw-r--r--binutils/readelf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 614f761..30a7fcc 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -12556,7 +12556,8 @@ get_archive_member_name (struct archive_info * arch,
/* We have a normal (short) name. */
j = 0;
- while ((arch->arhdr.ar_name[j] != '/') && (j < 16))
+ while ((arch->arhdr.ar_name[j] != '/')
+ && (j < sizeof (arch->arhdr.ar_name) - 1))
j++;
arch->arhdr.ar_name[j] = '\0';
return arch->arhdr.ar_name;