mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add bounds checks to scriptclass::tokenize()
It could index the `words` array out-of-bounds if there were more than 40 arguments in a command. Not like that would ever happen, but it's still good to be sure.
This commit is contained in:
@@ -56,9 +56,13 @@ void scriptclass::tokenize( std::string t )
|
||||
{
|
||||
tempword += currentletter;
|
||||
}
|
||||
if (j >= (int) SDL_arraysize(words))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tempword != "")
|
||||
if (tempword != "" && j < (int) SDL_arraysize(words))
|
||||
{
|
||||
words[j] = tempword;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user