Fix stack buffer overflows when parsing corrupt ihex files.
authorYuriy M. Kaminskiy <yumkam@gmail.com>
Tue, 4 Aug 2015 15:51:53 +0000 (16:51 +0100)
committerNick Clifton <nickc@redhat.com>
Tue, 4 Aug 2015 15:51:53 +0000 (16:51 +0100)
commit7e27a9d5f22f9f7ead11738b1546d0b5c737266b
tree46bffdfecd821e8f439790cab4da495658777807
parent4e13f8fb05eb7ffd163d96e519cc011d8d21e3d7
Fix stack buffer overflows when parsing corrupt ihex files.

PR binutils/18750
* ihex.c (ihex_scan): Fixes incorrect escape sequence in error message
and stack overflow when char is signed and \200-\376 was in place of hex
digit; also fixes \377 was handled as EOF instead of "incorrect character".
(ihex_read_section): Changed for consistency.
(ihex_bad_byte): Prevent (now impossible to trigger) stack
overflow and incorrect escape sequence handling.
* srec.c (srec_bad_byte): Likewise.

* readelf.c (process_mips_specific): Fix incorrect escape
sequence handling.
bfd/ChangeLog
bfd/ihex.c
bfd/srec.c
binutils/ChangeLog
binutils/readelf.c