diff options
author | Andrew Somerville <asomerville@carnegierobotics.com> | 2019-01-07 19:14:05 -0500 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2019-05-03 12:45:13 +0000 |
commit | f459a8ba6cb3f004411124328766cd1e2d4c9cd1 (patch) | |
tree | c3d2f1eae6041a6054140c10c67ee00a56a33956 | |
parent | ec19c381a0153be2f94e5a7a3294fa48b3d40c82 (diff) |
Check for 0 sized section header plt in fakeSymbolFromSection to prevent div by 0
Change-Id: Ic0e57b93991c03f9842b74d911697899ca35f7c0
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r-- | app/perfsymboltable.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp index 212cf01..27d0d58 100644 --- a/app/perfsymboltable.cpp +++ b/app/perfsymboltable.cpp @@ -768,7 +768,7 @@ static QByteArray fakeSymbolFromSection(Dwfl_Module *mod, Dwarf_Addr addr) if (!str || str == QLatin1String(".text")) return {}; - if (str == QLatin1String(".plt")) { + if (str == QLatin1String(".plt") && entsize > 0) { const auto *pltSymbol = findPltSymbol(elf, addr / entsize); if (pltSymbol) return demangle(pltSymbol) + "@plt"; |