diff options
Diffstat (limited to 'binutils/patches/pr13534-03.diff')
-rw-r--r-- | binutils/patches/pr13534-03.diff | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/binutils/patches/pr13534-03.diff b/binutils/patches/pr13534-03.diff new file mode 100644 index 0000000..454ccae --- /dev/null +++ b/binutils/patches/pr13534-03.diff @@ -0,0 +1,29 @@ +commit 23a979dc1779ac63cd799bfa2f6c2aed1f1bff66 +Author: Francois Gouget <fgouget@codeweavers.com> +Date: Tue Dec 20 18:41:35 2011 +0100 + + bfd: Fix parsing the size of archive elements larger than 2GB. + +diff --git a/bfd/archive.c b/bfd/archive.c +index 05aba6c..01acf98 100644 +--- a/bfd/archive.c ++++ b/bfd/archive.c +@@ -446,7 +446,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag) + { + struct ar_hdr hdr; + char *hdrp = (char *) &hdr; +- size_t parsed_size; ++ bfd_size_type parsed_size; + struct areltdata *ared; + char *filename = NULL; + bfd_size_type namelen = 0; +@@ -470,8 +470,7 @@ _bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag) + } + + errno = 0; +- parsed_size = strtol (hdr.ar_size, NULL, 10); +- if (errno != 0) ++ if (sscanf(hdr.ar_size, "%" BFD_VMA_FMT "u", &parsed_size) != 1) + { + bfd_set_error (bfd_error_malformed_archive); + return NULL; |