From ceaa0064ea879c6c30d174a7a4a970f41615ed16 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Thu, 24 Mar 2016 22:33:36 +0100 Subject: [PATCH] Check validity of allocation index when parsing data file. --- accumulatedtracedata.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/accumulatedtracedata.cpp b/accumulatedtracedata.cpp index 0c4bbc2..485d704 100644 --- 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 -- 2.7.4