From df35687a29fb72e43be9fdfe884ef45f82b8f206 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 16 May 2012 13:00:29 +0000 Subject: [PATCH] * archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf stops at end of ar_size field. --- bfd/ChangeLog | 5 +++++ bfd/archive.c | 1 + 2 files changed, 6 insertions(+) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 34bee4f1608..9db6ed35ae3 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2012-05-16 Alan Modra + + * archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf + stops at end of ar_size field. + 2012-05-16 Alan Modra PR ld/13962 diff --git a/bfd/archive.c b/bfd/archive.c index fd44f5405fe..eb5f5ec0cfa 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); -- 2.30.2