Sanity check loc_offsets index
authorAlan Modra <amodra@gmail.com>
Thu, 4 Aug 2022 12:13:22 +0000 (21:43 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 5 Aug 2022 11:18:29 +0000 (20:48 +0930)
commitdfbc689c699b3a15f11e8eb09cb05629f60b36b3
tree7404b8deef08685538738a7d1406e9fc01819e61
parent188bc85476e6ade99bd209ecf430601d56278e64
Sanity check loc_offsets index

Fixes a segfault found by the fuzzers.

* dwarf.c (fetch_indexed_value): Return -1 on error.
(read_and_display_attr_value): Don't display string when
fetch_indexed_value returns an error.  Sanity check loc_offsets
index.
binutils/dwarf.c