diff options
author | Aaron Merey <amerey@redhat.com> | 2024-03-13 16:18:27 -0400 |
---|---|---|
committer | Aaron Merey <amerey@redhat.com> | 2024-08-23 16:10:36 -0400 |
commit | aa35682ce5937c9fb9d936a29ef260b9916c8487 (patch) | |
tree | a7682fe2cf60392b95af650c0ccff3da17965fa5 /gdb/btrace.c | |
parent | 5637daa2064c44831f90e64df37bcd047160366e (diff) | |
download | gdb-aa35682ce5937c9fb9d936a29ef260b9916c8487.zip gdb-aa35682ce5937c9fb9d936a29ef260b9916c8487.tar.gz gdb-aa35682ce5937c9fb9d936a29ef260b9916c8487.tar.bz2 |
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: Tom de Vries <tdevries@suse.de>
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/btrace.c')
0 files changed, 0 insertions, 0 deletions