[Scummvm-git-logs] scummvm master -> e15a421b3903c84d488c1362a4d0887d322f5472

athrxx noreply at scummvm.org
Mon Sep 19 18:50:44 UTC 2022


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
703cd9102d KYRA: add check to avoid invalid mem access
e15a421b39 KYRA: add paranoia check


Commit: 703cd9102d68ee69e23d1680bae340e077e3ef91
    https://github.com/scummvm/scummvm/commit/703cd9102d68ee69e23d1680bae340e077e3ef91
Author: athrxx (athrxx at scummvm.org)
Date: 2022-09-19T20:49:24+02:00

Commit Message:
KYRA: add check to avoid invalid mem access

Changed paths:
    engines/kyra/gui/gui_lok.cpp


diff --git a/engines/kyra/gui/gui_lok.cpp b/engines/kyra/gui/gui_lok.cpp
index 678b84139e7..0c686595805 100644
--- a/engines/kyra/gui/gui_lok.cpp
+++ b/engines/kyra/gui/gui_lok.cpp
@@ -752,7 +752,9 @@ void GUI_LoK::updateSavegameString() {
 				Util::mergeUpdateJohabChars(prevTwoByteChar, newTwoByteChar, oneByteInput, _resetHanInput);
 				if (prevTwoByteChar) {
 					WRITE_BE_UINT16(&_savegameName[length - 2], prevTwoByteChar);
-					_savegameName[length] = _savegameName[length + 1] = 0;
+					_savegameName[length] = 0;
+					if (length < ARRAYSIZE(_savegameName) - 1)
+						_savegameName[length + 1] = 0;
 					_backupChars[_inputState++] = prevTwoByteChar;
 				}
 				// A new character will only be added if there is still space left.


Commit: e15a421b3903c84d488c1362a4d0887d322f5472
    https://github.com/scummvm/scummvm/commit/e15a421b3903c84d488c1362a4d0887d322f5472
Author: athrxx (athrxx at scummvm.org)
Date: 2022-09-19T20:49:28+02:00

Commit Message:
KYRA: add paranoia check

Changed paths:
    engines/kyra/engine/sprites_lol.cpp


diff --git a/engines/kyra/engine/sprites_lol.cpp b/engines/kyra/engine/sprites_lol.cpp
index a8651146690..055e4f8cf6b 100644
--- a/engines/kyra/engine/sprites_lol.cpp
+++ b/engines/kyra/engine/sprites_lol.cpp
@@ -1396,6 +1396,9 @@ int LoLEngine::checkForPossibleDistanceAttack(uint16 monsterBlock, int direction
 
 	int p = monsterBlock;
 
+	if (direction > 3)
+		return 5;
+
 	for (int i = 0; i < distance; i++) {
 		p = calcNewBlockPosition(p, direction);
 




More information about the Scummvm-git-logs mailing list