readelf: While printing .debug_loc make sure that next_off doesn't overflow.
authorMark Wielaard <mark@klomp.org>
Wed, 13 Jun 2018 13:21:37 +0000 (15:21 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 15 Jun 2018 22:20:53 +0000 (00:20 +0200)
commit6fbded3b73a1050e1efa410fc28a41fde29ed221
tree1bcf7c1a31a388df6a94137050feae647c0730fe
parent1e3c7b55cfc91ed80b743daad7517ad3e51b99e1
readelf: While printing .debug_loc make sure that next_off doesn't overflow.

Found by the afl fuzzer. The next offset (after a locview) comes from a
DIE loclist attribute. This could be a bogus value so large it overflows
the buffer and makes us print past the end of buffer.

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