diff options
author | Alan Modra <amodra@gmail.com> | 2020-02-26 17:02:38 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-02-26 20:51:33 +1030 |
commit | 02f7e7eed956b99ab2e80f8974fbe59e1d9b0dff (patch) | |
tree | bbf2050990524db353f484d2f8499d7d8252c6c9 /zlib/gzclose.c | |
parent | cc4c4f40a2b46e355684e450f59154cece591c39 (diff) | |
download | gdb-02f7e7eed956b99ab2e80f8974fbe59e1d9b0dff.zip gdb-02f7e7eed956b99ab2e80f8974fbe59e1d9b0dff.tar.gz gdb-02f7e7eed956b99ab2e80f8974fbe59e1d9b0dff.tar.bz2 |
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.
Diffstat (limited to 'zlib/gzclose.c')
0 files changed, 0 insertions, 0 deletions