mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-11-24 14:29:20 +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:
1 parent
c7774a3eb9
commit
c3e7ddca9c
1 file changed
+5
-1
@@ -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