mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix desync in CUtlbuffer::ParseToken
The if statement comparing 'nLen' with 'nMaxLen' increments 'nLen' first at all times, but the statement below that checks the delimiters seeks -1 from current pos, causing a desync. This could result in reading arbitrary memory on certain strings. This fix also fixes the useless need to 'snag' the delimiters from tokens.
This commit is contained in:
parent
a2468bb184
commit
4969a84030
@ -1429,10 +1429,7 @@ int64 CUtlBuffer::ParseToken(characterset_t* pBreaks, char* pTokenBuf, int64 nMa
|
||||
break;
|
||||
|
||||
if (IN_CHARACTERSET(*pBreaks, c) || c == '\"' || c <= ' ')
|
||||
{
|
||||
SeekGet(SEEK_CURRENT, -1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pTokenBuf[nLen] = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user