[lldb] Fix symbol table use after free
authorAugusto Noronha <augusto2112@me.com>
Fri, 6 Jan 2023 23:17:25 +0000 (15:17 -0800)
committerAugusto Noronha <augusto2112@me.com>
Mon, 9 Jan 2023 18:27:18 +0000 (10:27 -0800)
commit1d6243db90b09c61d78a14268bb88a73792b63ab
tree6b9bca9d58eafa15dc47bab601e46b848c72b25b
parent0fcbb12465b41f9ed3db358769380d4bff4107d3
[lldb] Fix symbol table use after free

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 out pointer to the symbol file
is valid before using it.
lldb/include/lldb/Symbol/SymbolFile.h
lldb/source/Symbol/SymbolFile.cpp