summaryrefslogtreecommitdiff
path: root/binutils
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
commit85a726fbb59bd8ca9f4578624ddc42e72af0d068 (patch)
treef85c02287bdba549b28dbfa0577744bd966bd85e /binutils
parent53e93a4a887dc3de700e93ab428dabf1643808a7 (diff)
downloadbinutils-redhat-85a726fbb59bd8ca9f4578624ddc42e72af0d068.tar.gz
PR binutils/11742
* readelf.c (get_archive_member_name): Do not read beyond the end of the ar_name field.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/readelf.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e86b293ac0..d051895754 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-12 Michael Haubenwallner <haubi@gentoo.org>
+
+ PR binutils/11742
+ * readelf.c (get_archive_member_name): Do not read beyond the end
+ of the ar_name field.
+
2010-08-03 Tristan Gingold <gingold@adacore.com>
* dwarf.c (display_debug_lines): Mark file argument unused.
diff --git a/binutils/readelf.c b/binutils/readelf.c
index 614f761e94..30a7fcc4a1 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;