From: Alan Modra Date: Wed, 16 May 2012 13:00:29 +0000 (+0000) Subject: * archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=df35687a29fb72e43be9fdfe884ef45f82b8f206;p=binutils-gdb.git * archive.c (_bfd_generic_read_ar_hdr_mag): Ensure sscanf stops at end of ar_size field. --- 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);