mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-09 23:03:01 +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++)
|
for (j = sMoveMonsPtr->minRow; j < rowCount; j++)
|
||||||
{
|
{
|
||||||
struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition);
|
struct BoxPokemon *boxMon = GetBoxedMonPtr(boxId, boxPosition);
|
||||||
|
// UB: possible null dereference
|
||||||
|
#ifdef UBFIX
|
||||||
|
if (boxMon != NULL)
|
||||||
sMoveMonsPtr->boxMons[monArrayId] = *boxMon;
|
sMoveMonsPtr->boxMons[monArrayId] = *boxMon;
|
||||||
|
#else
|
||||||
|
sMoveMonsPtr->boxMons[monArrayId] = *boxMon;
|
||||||
|
#endif
|
||||||
monArrayId++;
|
monArrayId++;
|
||||||
boxPosition++;
|
boxPosition++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user