Archive sanity checks
authorAlan Modra <amodra@gmail.com>
Wed, 26 Feb 2020 06:32:38 +0000 (17:02 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 26 Feb 2020 10:21:33 +0000 (20:51 +1030)
commit02f7e7eed956b99ab2e80f8974fbe59e1d9b0dff
treebbf2050990524db353f484d2f8499d7d8252c6c9
parentcc4c4f40a2b46e355684e450f59154cece591c39
Archive sanity checks

Adds some sanity checking to size values read from file.

* archive.c (do_slurp_bsd_armap): Increase minimum parsed_size, and
bfd_set_error on failing test.  Don't bother changing bfd_error on
file read error.  Check symdef_count is multiple of BSD_SYMDEF_SIZE.
Check sym name is within string buffer.  Use size_t for some vars.
(do_slurp_coff_armap): Use size_t for some variables, fix size of
int_buf.  Don't change bfd_error on file read error.  Use
_bfd_mul_overflow when calculating carsym buffer size.  Reorder
calculations to catch overflows before they occur.  malloc and
free raw armap rather than using bfd_alloc.  Read raw armap before
allocating carsym+strings buffer.
(_bfd_slurp_extended_name_table): Localize variables.  Check
name size against file size.
bfd/ChangeLog
bfd/archive.c
This page took 0.024737 seconds and 4 git commands to generate.