aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2012-05-16 13:00:29 +0000
committerAlan Modra <amodra@gmail.com>2012-05-16 13:00:29 +0000
commitdf35687a29fb72e43be9fdfe884ef45f82b8f206 (patch)
tree56f51e44f414a5bb6a24b006152f05c61fd298ed
parent101af531fe53c0288cb04f40e2d5c62925edfe4b (diff)
downloadgdb-df35687a29fb72e43be9fdfe884ef45f82b8f206.zip
gdb-df35687a29fb72e43be9fdfe884ef45f82b8f206.tar.gz
gdb-df35687a29fb72e43be9fdfe884ef45f82b8f206.tar.bz2
* archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf
stops at end of ar_size field.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/archive.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 34bee4f..9db6ed3 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2012-05-16 Alan Modra <amodra@gmail.com>
+ * archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf
+ stops at end of ar_size field.
+
+2012-05-16 Alan Modra <amodra@gmail.com>
+
PR ld/13962
PR ld/7023
* elf.c (bfd_section_from_shdr): Fail when .dynsym sh_info is
diff --git a/bfd/archive.c b/bfd/archive.c
index fd44f54..eb5f5ec 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -471,6 +471,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag)
}
errno = 0;
+ hdr.ar_fmag[0] = 0;
if (sscanf (hdr.ar_size, "%" BFD_VMA_FMT "u", &parsed_size) != 1)
{
bfd_set_error (bfd_error_malformed_archive);