Browse Source

PR28048, heap-buffer-overflow on readelf -Ww

PR 28048
	* dwarf.c (get_type_signedness): Don't run off end of buffer
	printing DW_FORM_string attribute.
binutils-2_37-branch
Alan Modra 5 years ago
parent
commit
4ff0bb2df5
  1. 6
      binutils/ChangeLog
  2. 2
      binutils/dwarf.c

6
binutils/ChangeLog

@ -1,3 +1,9 @@
2021-07-02 Alan Modra <amodra@gmail.com>
PR 28048
* dwarf.c (get_type_signedness): Don't run off end of buffer
printing DW_FORM_string attribute.
2021-07-01 Nick Clifton <nickc@redhat.com>
PR 28029

2
binutils/dwarf.c

@ -2211,7 +2211,7 @@ get_type_signedness (abbrev_entry *entry,
if (attr->form == DW_FORM_strp)
printf (", %s", fetch_indirect_string (uvalue));
else if (attr->form == DW_FORM_string)
printf (", %s", orig_data);
printf (", %.*s", (int) (end - orig_data), orig_data);
}
break;

Loading…
Cancel
Save