[Scummvm-git-logs] scummvm master -> 1c87f428d00d795297bdf8d4ef68eabf68a3e571

dreammaster paulfgilbert at gmail.com
Sun Jul 7 18:26:56 CEST 2019


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

Summary:
1c87f428d0 GLK: Fix off-by-one memory read


Commit: 1c87f428d00d795297bdf8d4ef68eabf68a3e571
    https://github.com/scummvm/scummvm/commit/1c87f428d00d795297bdf8d4ef68eabf68a3e571
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2019-07-07T09:26:52-07:00

Commit Message:
GLK: Fix off-by-one memory read

The for loop shouldn't check previous entity on the first iteration

Changed paths:
    engines/glk/alan2/alan2.cpp


diff --git a/engines/glk/alan2/alan2.cpp b/engines/glk/alan2/alan2.cpp
index ccac7a6..d875dee 100644
--- a/engines/glk/alan2/alan2.cpp
+++ b/engines/glk/alan2/alan2.cpp
@@ -161,8 +161,11 @@ static void syncEventQueue(Common::Serializer &s) {
 	EvtqElem *arr = eventq;
 
 	if (s.isLoading()) {
-		for (i = 0; arr[i - 1].time != 0; ++i)
+		i = 0;
+		do {
 			arr[i].synchronize(s);
+			i++;
+		} while (arr[i - 1].time != 0);
 		etop = i - 1;
 	} else {
 		// Mark the top





More information about the Scummvm-git-logs mailing list