diff --git a/Source/Core/Core/HLE/HLE_OS.cpp b/Source/Core/Core/HLE/HLE_OS.cpp index 300cb57cc6..6b6ada1110 100644 --- a/Source/Core/Core/HLE/HLE_OS.cpp +++ b/Source/Core/Core/HLE/HLE_OS.cpp @@ -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];