bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/14933] New: ar & ranlib generate truncated files on 32bit


From: alanh at fairlite dot co.uk
Subject: [Bug binutils/14933] New: ar & ranlib generate truncated files on 32bit platform.
Date: Sat, 08 Dec 2012 00:20:17 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14933

             Bug #: 14933
           Summary: ar & ranlib generate truncated files on 32bit
                    platform.
           Product: binutils
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


Hi,

Just moved from binutils 2.22 to 2.23 and ar & ranlib generated bad archives
with the message "file truncated".

Looking into the problem reveals that in archive.c we have at around line
2414....

file_ptr firstreal;
....
file_ptr max_first_real;

max_first_real <<= 31;

then later we do....

      /* The archive file format only has 4 bytes to store the offset
         of the member.  Check to make sure that firstreal has not grown
         too big.  */
      if (firstreal >= max_first_real)
        {
          bfd_set_error (bfd_error_file_truncated);
          return FALSE;
        }

I added a check that did this in the errored function.

printf("CHECK %d %d (%d)\n",firstreal,max_first_real,sizeof(file_ptr));

It came back with....

CHECK 104 -2147483648 (4)

So, shouldn't firstreal/max_first_real be ufile_ptr's ?

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]