[Scummvm-git-logs] scummvm master -> 64f09fa4afb7a8b3bf62e00fcd8c5404c42b60d6

Strangerke noreply at scummvm.org
Sat May 18 12:21:20 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:
64f09fa4af BAGEL: Add safeguards in SrafComputer to avoid out of bounds writes


Commit: 64f09fa4afb7a8b3bf62e00fcd8c5404c42b60d6
    https://github.com/scummvm/scummvm/commit/64f09fa4afb7a8b3bf62e00fcd8c5404c42b60d6
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-18T13:21:12+01:00

Commit Message:
BAGEL: Add safeguards in SrafComputer to avoid out of bounds writes

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 b305dcf8b0c..fcd286eb01d 100644
--- a/engines/bagel/spacebar/sraf_computer.cpp
+++ b/engines/bagel/spacebar/sraf_computer.cpp
@@ -5232,15 +5232,15 @@ void SrafComputer::saveSraffanVars() {
 }
 
 void SrafComputer::setMeetingResult(int nFlags, int nMetWith, bool bSucceeded) {
-	if (nFlags & mSeller) {
+	if ((nFlags & mSeller) && nMetWith < NUM_SELLERS) {
 		g_stSellerNames[nMetWith]._nMeetingResult = (bSucceeded ? SRAF_GOOD_MEETING : SRAF_BAD_MEETING);
 	}
 
-	if (nFlags & mBuyer) {
+	if ((nFlags & mBuyer) && nMetWith < NUM_BUYERS) {
 		g_stBuyerBids[nMetWith]._nMeetingResult = (bSucceeded ? SRAF_GOOD_MEETING : SRAF_BAD_MEETING);
 	}
 
-	if (nFlags & mOtherParty) {
+	if ((nFlags & mOtherParty) && nMetWith < NUM_OTHER_PARTYS) {
 		g_stOtherPartys[nMetWith]._nMeetingResult = (bSucceeded ? SRAF_GOOD_MEETING : SRAF_BAD_MEETING);
 	}
 }




More information about the Scummvm-git-logs mailing list