PR 27861
* dwarf.c (display_debug_str_offsets): Sanity check dwarf5
header length.
+2021-05-13 Alan Modra <amodra@gmail.com>
+
+ PR 27861
+ * dwarf.c (display_debug_str_offsets): Sanity check dwarf5
+ header length.
+
2021-05-13 Alan Modra <amodra@gmail.com>
PR 27860
}
else
{
- entries_end = curr + length;
+ if (length <= (dwarf_vma) (end - curr))
+ entries_end = curr + length;
+ else
+ {
+ warn (_("Section %s is too small %#lx\n"),
+ section->name, (unsigned long) section->size);
+ entries_end = end;
+ }
int version;
SAFE_BYTE_GET_AND_INC (version, curr, 2, end);