From 89947851fd73011739bc303e4561119aaa22cf13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 14 Sep 2017 20:18:02 +0200 Subject: [PATCH] Fixed invalid memory access --- src/nmeaparser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nmeaparser.cpp b/src/nmeaparser.cpp index 0592eb46..d1a4fbb6 100644 --- a/src/nmeaparser.cpp +++ b/src/nmeaparser.cpp @@ -507,16 +507,16 @@ bool NMEAParser::parse(QFile *file, QList &tracks, if (validSentence(line, len)) { if (!memcmp(line + 3, "RMC,", 4)) { - if (!readRMC(track, line + 7, len)) + if (!readRMC(track, line + 7, len - 7)) return false; } else if (!memcmp(line + 3, "GGA,", 4)) { - if (!readGGA(track, line + 7, len)) + if (!readGGA(track, line + 7, len - 7)) return false; } else if (!memcmp(line + 3, "WPL,", 4)) { - if (!readWPL(waypoints, line + 7, len)) + if (!readWPL(waypoints, line + 7, len - 7)) return false; } else if (!memcmp(line + 3, "ZDA,", 4)) { - if (!readZDA(line + 7, len)) + if (!readZDA(line + 7, len - 7)) return false; } }