When "getNextBlock" was called after "getNextLine", the pointer could still on the newline.

The pointer to a newline could not advance enough, when the line ended with \r\n. The resulting buffer was correct, as the buffer range went from <start> until \r, but that the pointer increased by just 1 could lead to the problem that the next pointer points at \n, which is still part of the newline and therefore, "getNextBlock" got 1 byte too much.

Refs Issue #4871
This commit is contained in:
Matthias Möller
2023-02-04 15:16:22 +01:00
parent 8c6b3fe69a
commit db72c6ee38
4 changed files with 19 additions and 1 deletions

View File

@@ -420,7 +420,7 @@ bool PLY::DOM::ParseHeader(IOStreamBuffer<char> &streamBuffer, std::vector<char>
if (PLY::Element::ParseElement(streamBuffer, buffer, &out)) {
// add the element to the list of elements
alElements.push_back(out);
} else if (TokenMatch(buffer, "end_header", 10)) { //checks for /n ending, if it doesn't end with /r/n
} else if (TokenMatch(buffer, "end_header", 10)) {
// we have reached the end of the header
break;
} else {