From da2d5dc8ad0d899ae7affed67801325d236cd8ca Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 20 Sep 2014 16:28:03 -0300 Subject: Fixed Bug 8325 Code did not expect sd->equip_index to be empty ( -1 ), which'd cause a crash as reported. Special Thanks to Gerz! http://hercules.ws/board/tracker/issue-8325-another-map-server-crash-on-skill-shield-spell/ Signed-off-by: shennetsind --- src/map/skill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 393c88df2..db1296260 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -8696,8 +8696,8 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin sc_start(src,bl,SC_SILENCE,100,skill_lv,sd->bonus.shieldmdef * 30000); } else { int opt = 0, val = 0, splashrange = 0; - struct item_data *shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]]; - if( !shield_data || shield_data->type != IT_ARMOR ) { + struct item_data *shield_data = NULL; + if( sd->equip_index[EQI_HAND_L] < 0 || !( shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]] ) || shield_data->type != IT_ARMOR ) { //Skill will first check if a shield is equipped. If none is found on the caster the skill will fail. clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); break; -- cgit v1.2.3-70-g09d2