RemoveComments: Fix out-of-bounds read when file ends with a comment

This commit is contained in:
Turo Lamminen
2017-12-24 22:14:39 +02:00
parent 0cc25491a4
commit 90cdd0f20c

View File

@@ -66,6 +66,10 @@ void CommentRemover::RemoveLineComments(const char* szComment,
if (!strncmp(szBuffer,szComment,len)) {
while (!IsLineEnd(*szBuffer))
*szBuffer++ = chReplacement;
if (!*szBuffer) {
break;
}
}
++szBuffer;
}