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