mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-24 19:45:07 +00:00
SAGA: Fix potential buffer overrun
This commit is contained in:
parent
678c5eadfa
commit
459be5e7b2
@ -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 == ' ')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user