diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2019-05-10 16:57:26 -0400 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2019-05-15 09:57:45 -0400 |
commit | 7bede82892a06e6c26989803e70f53697392dcf9 (patch) | |
tree | 5edec90b19a8c81d37c6903d0b563bcbe289a724 /elfcpp | |
parent | 905f5b3f1d20569e2788add66687e6de11130159 (diff) | |
download | binutils-7bede82892a06e6c26989803e70f53697392dcf9.zip binutils-7bede82892a06e6c26989803e70f53697392dcf9.tar.gz binutils-7bede82892a06e6c26989803e70f53697392dcf9.tar.bz2 |
Don't crash if dwarf_decode_macro_bytes's 'body' is NULL
Hi,
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
https://bugzilla.redhat.com/show_bug.cgi?id=1708786
During the Fedora RPM build process, gdb-add-index is invoked to
extract the DWARF index from the binary, and GDB will segfault because
dwarf2read.c:parse_definition_macro's 'body' variable is NULL.
The underlying problem is that Fedora's rpm-build's "debugedit"
program will silently corrupt .debug_macro strings when a binary is
compiled with -g3. This is being taken care of by Mark Wielaard,
here:
https://bugzilla.redhat.com/show_bug.cgi?id=1708786
However, I still feel it's important to make GDB more resilient
against invalid DWARF input, so I'm proposing this rather simple patch
to catch the situation when "body == NULL" (i.e., it's probably been
corrupted) and issue a complaint. This is not a real fix to the
problem, of course, but at least GDB is able to finish without
segfaulting.
OK for master?
gdb/ChangeLog:
2019-05-15 Sergio Durigan Junior <sergiodj@redhat.com>
Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
* dwarf2read.c (dwarf_decode_macro_bytes): Check whether 'body' is
NULL, and complain if that's the case.
Diffstat (limited to 'elfcpp')
0 files changed, 0 insertions, 0 deletions