diff options
author | Nick Clifton <nickc@redhat.com> | 2012-01-20 14:42:57 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2012-01-20 14:42:57 +0000 |
commit | f1bb16f888ae3230ecac7530db7b2dab3dcddfe2 (patch) | |
tree | c1353b3060a29ffcbedd7823afbc2412b1b98183 /bfd/bfdio.c | |
parent | 2128eb399e7c8ad74793352fa88fdee4a5767fe8 (diff) | |
download | gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.zip gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.tar.gz gdb-f1bb16f888ae3230ecac7530db7b2dab3dcddfe2.tar.bz2 |
PR binutils/13534
* archive.c (_bfd_ar_sizepad): New function. Correctly install and
pad the size field in an archive header.
(_bfd_generic_read_ar_hdr_mag): Use the correct type and scan
function for the archive size field.
(bfd_generic_openr_next_archived_file): Likewise.
(do_slurp_coff_armap): Likewise.
(_bfd_write_archive_contents): Likewise.
(_bfd_bsd44_write_ar_hdr): Use the new function.
(bfd_ar_hdr_from_filesystem): Likewise.
(_bfd_write_archive_contents): Likewise.
(bsd_write_armap): Likewise.
(coff_write_armap): Likewise.
* archive64.c (bfd_elf64_archive_write_armap): Likewise.
* bfdio.c (bfd_bread): Use correct type for archive element
sizes.
* ar.c (open_inarch): Likewise.
(extract_file): Likewise.
* libbfd-in.h (struct areltdata): Use correct types for
parsed_size and extra_size fields.
Prototype _bfd_ar_sizepad function.
* libbfd.h: Regenerate.
Diffstat (limited to 'bfd/bfdio.c')
-rw-r--r-- | bfd/bfdio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/bfdio.c b/bfd/bfdio.c index c142c17..6f8a7c9 100644 --- a/bfd/bfdio.c +++ b/bfd/bfdio.c @@ -185,7 +185,8 @@ bfd_bread (void *ptr, bfd_size_type size, bfd *abfd) this element. */ if (abfd->arelt_data != NULL) { - size_t maxbytes = arelt_size (abfd); + bfd_size_type maxbytes = arelt_size (abfd); + if (abfd->where + size > maxbytes) { if (abfd->where >= maxbytes) |