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:
1311b0e
)
Don't access invalid memory for tiny or broken input files.
author
Milian Wolff
<mail@milianw.de>
Wed, 24 Feb 2016 01:31:21 +0000
(
02:31
+0100)
committer
Milian Wolff
<mail@milianw.de>
Wed, 24 Feb 2016 01:31:21 +0000
(
02:31
+0100)
gui/parser.cpp
patch
|
blob
|
history
diff --git
a/gui/parser.cpp
b/gui/parser.cpp
index
fc24251
..
1a932b6
100644
(file)
--- a/
gui/parser.cpp
+++ b/
gui/parser.cpp
@@
-424,7
+424,7
@@
HistogramData buildSizeHistogram(ParserData& data)
return lhs.allocations > rhs.allocations;
});
// -1 to account for total row
- for (size_t i = 0; i <
size_t(HistogramRow::NUM_COLUMNS - 1
); ++i) {
+ for (size_t i = 0; i <
min(columnData.size(), size_t(HistogramRow::NUM_COLUMNS - 1)
); ++i) {
const auto& column = columnData[i];
row.columns[i + 1] = {column.allocations, column.location};
}