]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR 33638, debug_rnglists output
authorAlan Modra <amodra@gmail.com>
Fri, 21 Nov 2025 22:52:10 +0000 (09:22 +1030)
committerAlan Modra <amodra@gmail.com>
Fri, 21 Nov 2025 22:52:10 +0000 (09:22 +1030)
commit598704a00cbac5e85c2bedd363357b5bf6fcee33
tree4e209209fb5696de9a872d6c70eef3187ecc3a99
parent1529b30114989e324f9e555db9f994885c434e50
PR 33638, debug_rnglists output

The fuzzed testcase in this PR continuously outputs an error about
the debug_rnglists header.  Fixed by taking notice of the error and
stopping output.  The patch also limits the length in all cases, not
just when a relocation is present, and limits the offset entry count
read from the header.  I removed the warning and the test for relocs
because the code can't work reliably with unresolved relocs in the
length field.

PR 33638
* dwarf.c (display_debug_rnglists_list): Return bool.  Rename
"inital_length" to plain "length".  Verify length is large
enough to read header.  Limit length to rest of section.
Similarly limit offset_entry_count.
(display_debug_ranges): Check display_debug_rnglists_unit_header
return status.  Stop output on error.
binutils/dwarf.c