diff options
author | Sierraffinity <sierra@domoreaweso.me> | 2020-12-26 17:47:36 -0800 |
---|---|---|
committer | Sierraffinity <sierra@domoreaweso.me> | 2020-12-26 17:47:36 -0800 |
commit | bafbf9240d0f91ee3c38ca4652e3c54b9c503c9b (patch) | |
tree | 0182e62373191694f57f5f398f17f41803b96866 | |
parent | 86fdd033c62d54d679f2c28b5f446e2ef2df7e3e (diff) |
Add UBFIX for null deref in sub_80D08CC
-rw-r--r-- | src/pokemon_storage_system.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index db8f3d2bb..4be1cf729 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -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++; } |