From 106cb45b5780a48266393125edacd6811f09bd80 Mon Sep 17 00:00:00 2001 From: Aeadoin <109764533+Aeadoin@users.noreply.github.com> Date: Thu, 9 Feb 2023 10:35:51 -0500 Subject: [PATCH] [Crash] Fix potential crash in Mob::CommonDamage (#2848) out of bounds memory access. --- zone/attack.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index b4e0b60e8..fe1178e4a 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4093,7 +4093,8 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons a->source = 0; else a->source = attacker->GetID(); - a->type = SkillDamageTypes[skill_used]; // was 0x1c + a->type = (EQ::ValueWithin(skill_used, EQ::skills::Skill1HBlunt, EQ::skills::Skill2HPiercing)) ? + SkillDamageTypes[skill_used] : SkillDamageTypes[EQ::skills::SkillHandtoHand]; // was 0x1c a->damage = damage; a->spellid = spell_id; if (special == eSpecialAttacks::AERampage)