mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 17:33:05 +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--;
|
_statusTextInputPos--;
|
||||||
_statusTextInputString[_statusTextInputPos] = 0;
|
_statusTextInputString[_statusTextInputPos] = 0;
|
||||||
default:
|
default:
|
||||||
if (_statusTextInputPos > STATUS_TEXT_INPUT_MAX) {
|
if (_statusTextInputPos > STATUS_TEXT_INPUT_MAX - 1) { // -1 because of the null termination
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (Common::isAlnum(keystate.ascii) || (keystate.ascii == ' ')) {
|
if (Common::isAlnum(keystate.ascii) || (keystate.ascii == ' ')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user