Merge pull request #484 from turol/master
Fix read past end of buffer after call to TokenMatchpull/490/head
commit
3c56e978f7
|
@ -201,7 +201,12 @@ template <class char_t>
|
||||||
AI_FORCE_INLINE bool TokenMatch(char_t*& in, const char* token, unsigned int len)
|
AI_FORCE_INLINE bool TokenMatch(char_t*& in, const char* token, unsigned int len)
|
||||||
{
|
{
|
||||||
if (!::strncmp(token,in,len) && IsSpaceOrNewLine(in[len])) {
|
if (!::strncmp(token,in,len) && IsSpaceOrNewLine(in[len])) {
|
||||||
|
if (in[len] != '\0') {
|
||||||
in += len+1;
|
in += len+1;
|
||||||
|
} else {
|
||||||
|
// If EOF after the token make sure we don't go past end of buffer
|
||||||
|
in += len;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue