RemoveComments: Fix out-of-bounds read when file ends with a comment
This commit is contained in:
@@ -66,6 +66,10 @@ void CommentRemover::RemoveLineComments(const char* szComment,
|
||||
if (!strncmp(szBuffer,szComment,len)) {
|
||||
while (!IsLineEnd(*szBuffer))
|
||||
*szBuffer++ = chReplacement;
|
||||
|
||||
if (!*szBuffer) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
++szBuffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user