From f6ab4cd3779948edabe3dcd82b90f24c636ac512 Mon Sep 17 00:00:00 2001 From: Vayle Date: Sat, 31 Jan 2026 02:29:11 +0000 Subject: [PATCH] Skip effect removal loop for SPELL_SUPPRESSED in BuffFadeBySlot When BuffFadeBySlot() is called on a suppressed slot (e.g., when suppression timer expires), the effect removal loop accesses spells[SPELL_SUPPRESSED] (index 0xFFFD) which is out-of-bounds. This is unnecessary since effects were already removed when the buff was first suppressed. Skip the loop entirely for SPELL_SUPPRESSED slots to prevent OOB memory access and let execution proceed directly to the restoration branch. Fixes #29 --- zone/spell_effects.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index bd03298e1..a00fd93ec 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4268,6 +4268,9 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses, bool suppress, uint32 su } } + // Skip effect removal for suppressed slots — effects were already removed + // during initial suppression, and accessing spells[SPELL_SUPPRESSED] would be OOB. + if (buffs[slot].spellid != SPELL_SUPPRESSED) for (int i=0; i < EFFECT_COUNT; i++) { if(IsBlankSpellEffect(buffs[slot].spellid, i))