mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-04 18:30:07 +01:00
Add UBFIX for null deref in sub_80D08CC
This commit is contained in:
parent
86fdd033c6
commit
bafbf9240d
@ -8408,8 +8408,13 @@ static void sub_80D08CC(void)
|
||||
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||
{
|
||||
struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition);
|
||||
|
||||
// UB: possible null dereference
|
||||
#ifdef UBFIX
|
||||
if (boxMon != NULL)
|
||||
sMoveMonsPtr->boxMons[monArrayId] = *boxMon;
|
||||
#else
|
||||
sMoveMonsPtr->boxMons[monArrayId] = *boxMon;
|
||||
#endif
|
||||
monArrayId++;
|
||||
boxPosition++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user