aboutsummaryrefslogtreecommitdiff
path: root/bfd/archive.c
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 /bfd/archive.c
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.
Diffstat (limited to 'bfd/archive.c')
-rw-r--r--bfd/archive.c1
1 files changed, 1 insertions, 0 deletions
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);