This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] fix ar/ranlib regression with ar_fmag clobberation
- From: Alan Modra <amodra at gmail dot com>
- To: Roland McGrath <mcgrathr at google dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 18 May 2012 09:20:46 +0930
- Subject: Re: [PATCH] fix ar/ranlib regression with ar_fmag clobberation
- References: <x57jmx567czy.fsf@frobland.mtv.corp.google.com>
On Thu, May 17, 2012 at 01:45:37PM -0700, Roland McGrath wrote:
> This change:
>
> 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.
>
> results in clobbering the stored ar_fmag field. Among other things,
> this makes ranlib produce a malformed archive.
Doh! I looked at uses of hdr after that point, and missed seeing
memcpy (ared->arch_header, &hdr, sizeof (struct ar_hdr));
> * archive.c (_bfd_generic_read_ar_hdr_mag): Fix last change so as
> not to clobber the ar_fmag field stored in ARED->arch_header.
OK, thanks!
--
Alan Modra
Australia Development Lab, IBM