Skip to content
Commit aa35682c authored by Aaron Merey's avatar Aaron Merey
Browse files

gdb/dwarf2: Check for null abbrev_info ptr

A corrupt debuginfo file can result in a null abbrev_info pointer
being passed to cooked_indexer::scan_attributes.  This pointer
is set to nullptr by peek_die_abbrev when an abbrev of 0 is found.

There is no check for whether the abbrev pointer is null and
SIGSEGV occurs when attempting to dereference the pointer.

An abbrev of 0 normally indicates that the corresponding DIE is a
null entry, but scan_attributes expects a non-null DIE.

Fix this by throwing an error in cooked_indexer::scan_attributes
when peek_die_abbrev returns a nullptr in order to avoid
scan_attributes calling itself with a null abbrev.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31478


Co-authored-by: default avatarTom de Vries <tdevries@suse.de>
Approved-By: default avatarTom Tromey <tom@tromey.com>
parent 5637daa2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment