readelf: Check there are at least 4 bytes available for DWARF_FORM_block4.
authorMark Wielaard <mark@klomp.org>
Tue, 12 Jun 2018 12:36:50 +0000 (14:36 +0200)
committerMark Wielaard <mark@klomp.org>
Sat, 16 Jun 2018 23:04:39 +0000 (01:04 +0200)
commit58ed0e647f1012f8b75eda47967d849aeb619ec2
treed6d88f7ad7e518a03371c91556c5c1f75ebae004
parentcfe65047ad96500a8786625ef949099ec5671774
readelf: Check there are at least 4 bytes available for DWARF_FORM_block4.

Found by afl-fuzz. When printing a DWARF_FORM_block4 we checked there
were only 2 bytes available (copy/paste from DW_FORM_block2 right
before). Obviously we need at least 4 bytes to read the length of a
DW_FORM_block4.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/readelf.c