From b1139b658d72952b8fa18a49c41583b049de1775 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Mon, 14 Dec 2015 18:48:03 +0100 Subject: [PATCH] Reject data files of newer heaptrack versions. --- accumulatedtracedata.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accumulatedtracedata.cpp b/accumulatedtracedata.cpp index 034646e..8829c23 100644 --- a/accumulatedtracedata.cpp +++ b/accumulatedtracedata.cpp @@ -29,6 +29,7 @@ #include #include "linereader.h" +#include "config.h" using namespace std; @@ -323,6 +324,11 @@ bool AccumulatedTraceData::read(istream& in) fromAttached = true; } else if (reader.mode() == 'v') { reader >> fileVersion; + if (fileVersion > HEAPTRACK_VERSION) { + cerr << "The data file was written by a newer heaptrack of version " << hex << fileVersion + << " and is thus not compatible with this build of heaptrack version " << hex << HEAPTRACK_VERSION << '.' << endl; + return false; + } } else { cerr << "failed to parse line: " << reader.line() << endl; } -- 2.7.4