SAGA: Fix potential buffer overrun

This commit is contained in:
Eugene Sandulenko 2016-05-31 13:18:24 +02:00
parent 678c5eadfa
commit 459be5e7b2

View File

@ -1170,7 +1170,7 @@ void Interface::processStatusTextInput(Common::KeyState keystate) {
_statusTextInputPos--;
_statusTextInputString[_statusTextInputPos] = 0;
default:
if (_statusTextInputPos > STATUS_TEXT_INPUT_MAX) {
if (_statusTextInputPos > STATUS_TEXT_INPUT_MAX - 1) { // -1 because of the null termination
break;
}
if (Common::isAlnum(keystate.ascii) || (keystate.ascii == ' ')) {