From 84b88781a0c39f7379ed85f74dc03c4e868a171f Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sat, 17 Jan 2015 15:59:12 -0200 Subject: 10 Distinct fixes Addressing out of bounds read-write. Special Thanks to 4144, Haruna! Signed-off-by: shennetsind --- src/map/battle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map/battle.c') diff --git a/src/map/battle.c b/src/map/battle.c index edb5fd69f..998fad0af 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -325,7 +325,7 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d if (atk_elem < 0 || atk_elem >= ELE_MAX) atk_elem = rnd()%ELE_MAX; - if (def_type < 0 || def_type > ELE_MAX || + if (def_type < 0 || def_type >= ELE_MAX || def_lv < 1 || def_lv > 4) { ShowError("battle_attr_fix: unknown attr type: atk=%d def_type=%d def_lv=%d\n",atk_elem,def_type,def_lv); return damage; -- cgit v1.2.3-70-g09d2