[Scummvm-git-logs] scummvm master -> 16cc2f6034571d80b09a018a2d7e811a0801824a

sev- noreply at scummvm.org
Sat May 11 07:49:29 UTC 2024


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:
d35e881707 BAGEL: Fix out of bounds read. CID 1544824, 1544831, 1544852
16cc2f6034 BAGEL: Fix copy/paste error


Commit: d35e881707c118acd39c025c55cd3062ab46c3e7
    https://github.com/scummvm/scummvm/commit/d35e881707c118acd39c025c55cd3062ab46c3e7
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-11T09:48:29+02:00

Commit Message:
BAGEL: Fix out of bounds read. CID 1544824, 1544831, 1544852

Changed paths:
    engines/bagel/spacebar/sraf_computer.cpp


diff --git a/engines/bagel/spacebar/sraf_computer.cpp b/engines/bagel/spacebar/sraf_computer.cpp
index 1e921cb9b94..880b96eb502 100644
--- a/engines/bagel/spacebar/sraf_computer.cpp
+++ b/engines/bagel/spacebar/sraf_computer.cpp
@@ -2501,9 +2501,9 @@ int SrafComputer::getAdjustedIndex(int nListToSearch, int nElementIndex, bool bS
 		// Adjust for out of range.
 		nElementIndex = (nElementIndex >= NUM_OTHER_PARTYS ? (NUM_OTHER_PARTYS - 1) : nElementIndex);
 
-		for (int i = 0; i <= NUM_OTHER_PARTYS; i++) {
+		for (int i = 0; i < NUM_OTHER_PARTYS; i++) {
 			// Get all consecutive that are not available.
-			while (i <= NUM_OTHER_PARTYS && g_stOtherPartys[i]._bAvailable == false) {
+			while (i < NUM_OTHER_PARTYS && g_stOtherPartys[i]._bAvailable == false) {
 				nTotalNotAvail++;
 				i++;
 			}
@@ -2520,9 +2520,9 @@ int SrafComputer::getAdjustedIndex(int nListToSearch, int nElementIndex, bool bS
 		// Adjust for out of range.
 		nElementIndex = (nElementIndex >= NUM_SELLERS ? (NUM_SELLERS - 1) : nElementIndex);
 
-		for (int i = 0; i <= NUM_BUYERS; i++) {
+		for (int i = 0; i < NUM_BUYERS; i++) {
 			// get all consecutive that are not available.
-			while (i <= NUM_SELLERS && g_stSellerNames[i]._bAvailable == false) {
+			while (i < NUM_SELLERS && g_stSellerNames[i]._bAvailable == false) {
 				nTotalNotAvail++;
 				i++;
 			}
@@ -2539,9 +2539,9 @@ int SrafComputer::getAdjustedIndex(int nListToSearch, int nElementIndex, bool bS
 		// Adjust for out of range.
 		nElementIndex = (nElementIndex >= NUM_BUYERS ? (NUM_BUYERS - 1) : nElementIndex);
 
-		for (int i = 0; i <= NUM_BUYERS; i++) {
+		for (int i = 0; i < NUM_BUYERS; i++) {
 			// Get all consecutive that are not available.
-			while (i <= NUM_BUYERS && g_stBuyerBids[i]._bAvailable == false) {
+			while (i < NUM_BUYERS && g_stBuyerBids[i]._bAvailable == false) {
 				nTotalNotAvail++;
 				i++;
 			}
@@ -2558,9 +2558,9 @@ int SrafComputer::getAdjustedIndex(int nListToSearch, int nElementIndex, bool bS
 		// Adjust for out of range.
 		nElementIndex = (nElementIndex >= NUM_STAFFERS ? (NUM_STAFFERS - 1) : nElementIndex);
 
-		for (int i = 0; i <= NUM_BUYERS; i++) {
+		for (int i = 0; i < NUM_BUYERS; i++) {
 			// Get all consecutive that are not available.
-			while (i <= NUM_STAFFERS && g_staffers[i]._bAvailable == false) {
+			while (i < NUM_STAFFERS && g_staffers[i]._bAvailable == false) {
 				nTotalNotAvail++;
 				i++;
 			}


Commit: 16cc2f6034571d80b09a018a2d7e811a0801824a
    https://github.com/scummvm/scummvm/commit/16cc2f6034571d80b09a018a2d7e811a0801824a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-11T09:49:11+02:00

Commit Message:
BAGEL: Fix copy/paste error

Changed paths:
    engines/bagel/spacebar/sraf_computer.cpp


diff --git a/engines/bagel/spacebar/sraf_computer.cpp b/engines/bagel/spacebar/sraf_computer.cpp
index 880b96eb502..5b259ea018c 100644
--- a/engines/bagel/spacebar/sraf_computer.cpp
+++ b/engines/bagel/spacebar/sraf_computer.cpp
@@ -2558,7 +2558,7 @@ int SrafComputer::getAdjustedIndex(int nListToSearch, int nElementIndex, bool bS
 		// Adjust for out of range.
 		nElementIndex = (nElementIndex >= NUM_STAFFERS ? (NUM_STAFFERS - 1) : nElementIndex);
 
-		for (int i = 0; i < NUM_BUYERS; i++) {
+		for (int i = 0; i < NUM_STAFFERS; i++) {
 			// Get all consecutive that are not available.
 			while (i < NUM_STAFFERS && g_staffers[i]._bAvailable == false) {
 				nTotalNotAvail++;




More information about the Scummvm-git-logs mailing list