HLE_OS: More bounds checking in GetStringVA

This commit is contained in:
JosJuice 2016-11-12 16:27:03 +01:00
parent 3d80d454ce
commit b47e607105
1 changed files with 7 additions and 1 deletions

View File

@ -87,8 +87,14 @@ std::string GetStringVA(u32 strReg)
result += '%';
continue;
}
while (string[i] < 'A' || string[i] > 'z' || string[i] == 'l' || string[i] == '-')
while (i < string.size() &&
(string[i] < 'A' || string[i] > 'z' || string[i] == 'l' || string[i] == '-'))
{
ArgumentBuffer += string[i++];
}
if (i >= string.size())
break;
ArgumentBuffer += string[i];