mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-03 00:35:54 +00:00
BAGEL: Add safeguards in SrafComputer to avoid out of bounds writes
This commit is contained in:
parent
0a034af1b2
commit
64f09fa4af
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user