From b4fe045060343867a582ae733db66aeca1f33ffd Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Fri, 18 Jun 2021 13:33:40 +0200 Subject: [PATCH] fsparser: don't try to analyze header after then end of header area --- src/fsparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fsparser.cpp b/src/fsparser.cpp index 78f3424..fcae7bc 100644 --- a/src/fsparser.cpp +++ b/src/fsparser.cpp @@ -50,6 +50,7 @@ int FsParser::parseHeader() int ret = 0; string buffer; int line_index = 0; + bool in_header = true; istringstream lineStream(_raw_data); @@ -67,6 +68,9 @@ int FsParser::parseHeader() */ _lstRawData.push_back(buffer); + if (!in_header) + continue; + uint8_t c = bitToVal(buffer.substr(0, 8).c_str(), 8); uint8_t key = c & 0x7F; uint64_t val = bitToVal(buffer.c_str(), buffer.size()); @@ -112,6 +116,7 @@ int FsParser::parseHeader() break; case 0x3B: /* last header line with crc and cfg data length */ /* documentation issue */ + in_header = false; uint8_t crc; crc = 0x01 & (val >> 23);