From 41d1bbe13750c78df3de1d5f2d64e1a05890ec33 Mon Sep 17 00:00:00 2001 From: Jeffrey Crowell Date: Thu, 21 Jul 2022 18:27:44 -0400 Subject: [PATCH] Fix nullptr dereference in morpha (#870) reported on discord, i don't have the ability to reproduce this, but it appears to be a benign fix, as the only time that the tent2 is checked down later is guarded by a null check. --- soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 8adea13af..3dbc97a07 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -929,7 +929,7 @@ void BossMo_Tentacle(BossMo* this, GlobalContext* globalCtx) { this->actor.flags &= ~ACTOR_FLAG_0; Math_ApproachF(&this->baseAlpha, 0.0, 1.0f, 5.0f); for (indS1 = 0; indS1 < 40; indS1++) { - if (sMorphaTent2->tentSpawnPos) {} + if (sMorphaTent2 && sMorphaTent2->tentSpawnPos) {} indT5 = Rand_ZeroFloat(20.9f); indS0 = sTentSpawnIndex[indT5]; spFC.x = 0; @@ -3604,4 +3604,4 @@ void BossMo_Reset(void) { sBossGanonSeed1 = 0; sBossGanonSeed2 = 0; sBossGanonSeed3 = 0; -} \ No newline at end of file +}