projects
/
sdk
/
tools
/
heaptrack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
399d945
)
Check validity of allocation index when parsing data file.
author
Milian Wolff
<mail@milianw.de>
Thu, 24 Mar 2016 21:33:36 +0000
(22:33 +0100)
committer
Milian Wolff
<mail@milianw.de>
Thu, 24 Mar 2016 21:33:36 +0000
(22:33 +0100)
accumulatedtracedata.cpp
patch
|
blob
|
history
diff --git
a/accumulatedtracedata.cpp
b/accumulatedtracedata.cpp
index
0c4bbc2
..
485d704
100644
(file)
--- a/
accumulatedtracedata.cpp
+++ b/
accumulatedtracedata.cpp
@@
-223,6
+223,9
@@
bool AccumulatedTraceData::read(istream& in)
if (!(reader >> allocationIndex.index)) {
cerr << "failed to parse line: " << reader.line() << endl;
continue;
+ } else if (allocationIndex.index >= allocationInfos.size()) {
+ cerr << "allocation index out of bounds: " << allocationIndex.index << ", maximum is: " << allocationInfos.size() << endl;
+ continue;
}
info = allocationInfos[allocationIndex.index];
} else { // backwards compatibility