summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorAndrew Somerville <asomerville@carnegierobotics.com>2019-01-07 19:14:05 -0500
committerUlf Hermann <ulf.hermann@qt.io>2019-05-03 12:45:13 +0000
commitf459a8ba6cb3f004411124328766cd1e2d4c9cd1 (patch)
treec3d2f1eae6041a6054140c10c67ee00a56a33956 /app
parentec19c381a0153be2f94e5a7a3294fa48b3d40c82 (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>
Diffstat (limited to 'app')
-rw-r--r--app/perfsymboltable.cpp2
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";