[Scummvm-cvs-logs] scummvm master -> 8109ffd2532aab439953a1b4f4d867d76e990870

sev- sev at scummvm.org
Mon Oct 7 23:10:00 CEST 2013


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

Summary:
aac0924b0e AGI: Fix buffer overrun. CID 1004030
dcad1cfb55 AGI: Fix buffer overrun. CID 1004033
8109ffd253 AGI: Fix potential buffer overrun. CID 1004028


Commit: aac0924b0e7d23721b59b94b2a5762a470fcac93
    https://github.com/scummvm/scummvm/commit/aac0924b0e7d23721b59b94b2a5762a470fcac93
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-07T13:05:43-07:00

Commit Message:
AGI: Fix buffer overrun. CID 1004030

Changed paths:
    engines/agi/loader_v3.cpp



diff --git a/engines/agi/loader_v3.cpp b/engines/agi/loader_v3.cpp
index 250d8e7..1dd00dc 100644
--- a/engines/agi/loader_v3.cpp
+++ b/engines/agi/loader_v3.cpp
@@ -257,7 +257,7 @@ int AgiLoader_v3::loadResource(int t, int n) {
 	int ec = errOK;
 	uint8 *data = NULL;
 
-	if (n > MAX_DIRS)
+	if (n >= MAX_DIRS)
 		return errBadResource;
 
 	switch (t) {


Commit: dcad1cfb5563e81add678857771874ef57571976
    https://github.com/scummvm/scummvm/commit/dcad1cfb5563e81add678857771874ef57571976
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-07T13:07:25-07:00

Commit Message:
AGI: Fix buffer overrun. CID 1004033

Changed paths:
    engines/agi/loader_v2.cpp



diff --git a/engines/agi/loader_v2.cpp b/engines/agi/loader_v2.cpp
index ee69bb5..458927a 100644
--- a/engines/agi/loader_v2.cpp
+++ b/engines/agi/loader_v2.cpp
@@ -178,7 +178,7 @@ int AgiLoader_v2::loadResource(int t, int n) {
 	uint8 *data = NULL;
 
 	debugC(3, kDebugLevelResources, "(t = %d, n = %d)", t, n);
-	if (n > MAX_DIRS)
+	if (n >= MAX_DIRS)
 		return errBadResource;
 
 	switch (t) {


Commit: 8109ffd2532aab439953a1b4f4d867d76e990870
    https://github.com/scummvm/scummvm/commit/8109ffd2532aab439953a1b4f4d867d76e990870
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2013-10-07T13:13:30-07:00

Commit Message:
AGI: Fix potential buffer overrun. CID 1004028

Changed paths:
    engines/agi/loader_v1.cpp
    engines/agi/opcodes.cpp



diff --git a/engines/agi/loader_v1.cpp b/engines/agi/loader_v1.cpp
index 33e956a..3b862ed 100644
--- a/engines/agi/loader_v1.cpp
+++ b/engines/agi/loader_v1.cpp
@@ -202,7 +202,7 @@ int AgiLoader_v1::loadResource(int t, int n) {
 	uint8 *data = NULL;
 
 	debugC(3, kDebugLevelResources, "(t = %d, n = %d)", t, n);
-	if (n > MAX_DIRS)
+	if (n >= MAX_DIRS)
 		return errBadResource;
 
 	switch (t) {
diff --git a/engines/agi/opcodes.cpp b/engines/agi/opcodes.cpp
index 807ab2d..d893e44 100644
--- a/engines/agi/opcodes.cpp
+++ b/engines/agi/opcodes.cpp
@@ -367,6 +367,18 @@ void AgiEngine::setupOpcodes() {
 
 		logicNamesTest = insV2Test;
 		logicNamesCmd = insV2;
+
+		// Alter opcode parameters for specific games
+		// TODO: This could be either turned into a game feature, or a version
+		// specific check, instead of a game version check
+
+		// The Apple IIGS versions of MH1 and Goldrush both have a parameter for
+		// show.mouse and hide.mouse. Fixes bugs #3577754 and #3426946.
+		if ((getGameID() == GID_MH1 || getGameID() == GID_GOLDRUSH) &&
+			getPlatform() == Common::kPlatformApple2GS) {
+			logicNamesCmd[176].args = "n";	// hide.mouse
+			logicNamesCmd[178].args = "n";	// show.mouse
+		}
 	} else {
 		for (int i = 0; i < ARRAYSIZE(insV1Test); ++i)
 			_agiCondCommands[i] = insV1Test[i].func;
@@ -376,18 +388,6 @@ void AgiEngine::setupOpcodes() {
 		logicNamesTest = insV1Test;
 		logicNamesCmd = insV1;
 	}
-
-	// Alter opcode parameters for specific games
-	// TODO: This could be either turned into a game feature, or a version
-	// specific check, instead of a game version check
-
-	// The Apple IIGS versions of MH1 and Goldrush both have a parameter for
-	// show.mouse and hide.mouse. Fixes bugs #3577754 and #3426946.
-	if ((getGameID() == GID_MH1 || getGameID() == GID_GOLDRUSH) &&
-		getPlatform() == Common::kPlatformApple2GS) {
-		logicNamesCmd[176].args = "n";	// hide.mouse
-		logicNamesCmd[178].args = "n";	// show.mouse
-	}
 }
 
 }






More information about the Scummvm-git-logs mailing list