Fix memory access violations triggered by running readelf on fuzzed binaries.
authorNick Clifton <nickc@redhat.com>
Tue, 3 Feb 2015 20:42:36 +0000 (20:42 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 3 Feb 2015 20:42:36 +0000 (20:42 +0000)
commit570286220e28e606e199b37a06cd199cadb592ba
tree4bab2058d947ccc70a61bde391202554159aee79
parenta7606d8083c9e217294f6e47a8d2903716c6337c
Fix memory access violations triggered by running readelf on fuzzed binaries.

PR binutils/17531
* dwarf.c (process_debug_info): Add range check.
(display_debug_pubnames_worker): Likewise.
(display_gdb_index): Fix range check.
(process_cu_tu_index): Add range check.
* readelf.c (get_data): Change parameter types from size_t to
bfd_size_type.  Add checks for loss of accuracy when casting from
bfd_size_type to size_t.
(get_dynamic_data): Likewise.
(process_section_groups): Limit number of error messages.
binutils/ChangeLog
binutils/dwarf.c
binutils/readelf.c