Fix invalid memory access attempting to read the compression header of a too-small...
authorNick Clifton <nickc@redhat.com>
Mon, 13 Feb 2017 14:52:48 +0000 (14:52 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 13 Feb 2017 14:52:48 +0000 (14:52 +0000)
commitebdf1ebfa551fd4624c3cd05401aa3c01ea2ebbe
tree87e2c413c7e1b3bfec0146c82309662ca8a16a66
parent4aeb00ad3cc6a29b32f0a4e42c2f64d55e25b76d
Fix invalid memory access attempting to read the compression header of a too-small compressed section.

PR binutils/21149
* readelf.c (get_compression_header): Add size parameter.  Check
size against sizeof compression header before attempting to
extract the header.
(process_section_headers): Pass size to get_compression_header.
(dump_section_as_strings): Likewise.
(dump_section_as_bytes): Likewise.
(load_specific_debug_section): Likewise.
binutils/ChangeLog
binutils/readelf.c