[PATCH] Don't crash is dwarf_decode_macro_bytes's 'body' is NULL, even when '!is_define'

Tom Tromey tromey@adacore.com
Wed May 29 15:55:00 GMT 2019


>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:

Sergio> Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1715008
Sergio> On commit 7bede82892a06e6c26989803e70f53697392dcf9 ("Don't crash if
Sergio> dwarf_decode_macro_bytes's 'body' is NULL"), I was too strict when
Sergio> checking if 'body' is NULL: the check only comprised the case when
Sergio> 'is_define' is true.  However, the corruption of .debug_macro by
Sergio> rpmbuild's "debugedit" also affects the case when 'is_define' is
Sergio> false, i.e., when the macro is being undefined.

Sergio> This commit improves the check and covers both cases now.  This has
Sergio> been tested on Fedora 30 with a problematic debuginfo, and I don't see
Sergio> a segfault anymore.

Sergio> OK to push?

Thanks for doing this.  This is ok.

Tom



More information about the Gdb-patches mailing list