Fix access violation when parsing a corrupt IEEE binary.
authorNick Clifton <nickc@redhat.com>
Mon, 19 Jun 2017 13:06:53 +0000 (14:06 +0100)
committerNick Clifton <nickc@redhat.com>
Mon, 19 Jun 2017 13:06:53 +0000 (14:06 +0100)
commitacb56a83016611bcb5f0a32368fddc8c213f7dd0
tree15775f42f8fd3c86216078c424f834052c8450b8
parent80053e466b3a8055334b9be9bac7d99e0d617cbe
Fix access violation when parsing a corrupt IEEE binary.

PR binutils/21612
* libieee.h (struct common_header_type): Add end_p field.
* ieee.c (this_byte_and_next): Do not advance input_p beyond
end_p.
(read_id): Check for a length that exceeds the remaining bytes in
the input buffer.
(ieee_seek): Initialise end_p.
(ieee_archive_p): Likewise.
(ieee_object_p): Likewise.
bfd/ChangeLog
bfd/ieee.c
bfd/libieee.h