This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix ar/ranlib regression with ar_fmag clobberation


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]