Fix a null pointer dereference if dladdr is unable to find a symbol name (flutter/engine#23970)

This commit is contained in:
Jason Simmons
2021-01-27 14:14:01 -08:00
committed by GitHub
parent 792e907131
commit 0af9029a51

View File

@@ -50,6 +50,9 @@ static std::string GetSymbolName(void* symbol) {
if (::dladdr(symbol, &info) == 0) {
return kKUnknownFrameName;
}
if (info.dli_sname == nullptr) {
return kKUnknownFrameName;
}
return DemangleSymbolName({info.dli_sname});
}