[Scummvm-git-logs] scummvm master -> 826660b92a149016bf9655372a71ddf201311f51

bluegr noreply at scummvm.org
Mon Dec 2 00:37:14 UTC 2024


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:
826660b92a DREAMWEB: Avoid out of bound read with empty strings in printDirect


Commit: 826660b92a149016bf9655372a71ddf201311f51
    https://github.com/scummvm/scummvm/commit/826660b92a149016bf9655372a71ddf201311f51
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2024-12-02T02:37:11+02:00

Commit Message:
DREAMWEB: Avoid out of bound read with empty strings in printDirect

In the French version of the game, right at the start (in the first
scene) there was a crash due to an out of bound read with a string
of length 1 (empty, with only the '\0' character). This commit
moves reading the next character to after checking that that the
character is not '\0' to avoid this out of bound read.
This fixes bug #15546.

Changed paths:
    engines/dreamweb/print.cpp


diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index e7ae51462a4..e95cd56ec86 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -138,11 +138,11 @@ uint8 DreamWebEngine::printDirect(const uint8** string, uint16 x, uint16 *y, uin
 		uint16 i = offset;
 		do {
 			uint8 c = (*string)[0];
-			uint8 nextChar = (*string)[1];
-			++(*string);
 			if ((c == 0) || (c == ':')) {
 				return c;
 			}
+			uint8 nextChar = (*string)[1];
+			++(*string);
 			c = modifyChar(c);
 			uint8 width, height;
 			printChar(charSet, &i, *y, c, nextChar, &width, &height);




More information about the Scummvm-git-logs mailing list