summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-17 15:59:12 -0200
committershennetsind <ind@henn.et>2015-01-17 15:59:12 -0200
commit84b88781a0c39f7379ed85f74dc03c4e868a171f (patch)
tree41f0392d7d872fb038b42ddc82bde56be4582e47 /src/map/battle.c
parent36fa0940d5c97457f7093d81e7d298c88dac14af (diff)
downloadhercules-84b88781a0c39f7379ed85f74dc03c4e868a171f.tar.gz
hercules-84b88781a0c39f7379ed85f74dc03c4e868a171f.tar.bz2
hercules-84b88781a0c39f7379ed85f74dc03c4e868a171f.tar.xz
hercules-84b88781a0c39f7379ed85f74dc03c4e868a171f.zip
10 Distinct fixes
Addressing out of bounds read-write. Special Thanks to 4144, Haruna! Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c2
1 files changed, 1 insertions, 1 deletions
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;