This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix symbol table use after free
AcceptedPublic

Authored by augusto2112 on Jan 6 2023, 3:28 PM.

Details

Summary

The symbol file stores a raw pointer to the main object file's symbol
table. This pointer, however, can be freed, if ObjectFile::ClearSymtab
is ever called. This patch makes sure the pointer to the symbol file
is valid before using it.

Diff Detail

Event Timeline

augusto2112 created this revision.Jan 6 2023, 3:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 3:28 PM
augusto2112 requested review of this revision.Jan 6 2023, 3:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2023, 3:28 PM
JDevlieghere accepted this revision.Jan 6 2023, 4:41 PM

LGTM

lldb/source/Symbol/SymbolFile.cpp
188–190
This revision is now accepted and ready to land.Jan 6 2023, 4:41 PM