Skip to content

Conversation

@EricRahm
Copy link
Collaborator

@EricRahm EricRahm commented Jan 5, 2026

When processing malformed DWARF data, specifically a compile unit
where a top-level DIE attribute requires indirect address resolution
(e.g., DW_AT_GNU_dwo_id using DW_FORM_addrx), Bloaty would crash.
This occurred because ReadTopLevelDIE was called before skeleton_
was initialized in CU::ReadHeader, leading to a null pointer
dereference in ReadIndirectAddress.

This patch moves the initialization of skeleton_ to the beginning
of CU::ReadHeader to ensure it is available when reading top-level
attributes.

Fixes #402
Fixes #409
Fixes #463

When processing malformed DWARF data, specifically a compile unit
where a top-level DIE attribute requires indirect address resolution
(e.g., DW_AT_GNU_dwo_id using DW_FORM_addrx), Bloaty would crash.
This occurred because `ReadTopLevelDIE` was called before `skeleton_`
was initialized in `CU::ReadHeader`, leading to a null pointer
dereference in `ReadIndirectAddress`.

This patch moves the initialization of `skeleton_` to the beginning
of `CU::ReadHeader` to ensure it is available when reading top-level
attributes.

Fixes google#402
@EricRahm
Copy link
Collaborator Author

EricRahm commented Jan 5, 2026

@haberman This is a very small fix that fixes at least 3 reported issues.

@EricRahm EricRahm merged commit 2e3d747 into google:main Jan 6, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OSS-Fuzz issue 462929298 Crash Report: SEGV in ReadIndirectAddress Crash Report: SEGV in CU::dwarf()

2 participants