libdw: Check terminating NUL byte in dwarf_getsrclines for dir/file table.
authorMark Wielaard <mark@klomp.org>
Sun, 20 Jan 2019 21:10:18 +0000 (22:10 +0100)
committerMark Wielaard <mark@klomp.org>
Tue, 22 Jan 2019 17:12:38 +0000 (18:12 +0100)
commit2562759d6fe5b364fe224852e64e8bda39eb2e35
tree40b5cf97caffae1248cd39305434e1dbf914527d
parentda5c5336a1eaf519de246f7d9f0f5585e1d4ac59
libdw: Check terminating NUL byte in dwarf_getsrclines for dir/file table.

For DWARF version < 5 the .debug_line directory and file tables consist
of a terminating NUL byte after all strings. The code used to just skip
this without checking it actually existed. This could case a spurious
read past the end of data.

Fix the same issue in readelf.

https://sourceware.org/bugzilla/show_bug.cgi?id=24102

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