summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-09-13 10:26:01 +0200
committerHaru <haru@dotalux.com>2016-09-13 10:26:01 +0200
commit3119f6e757ec0c0b43a312954a5a3c09b27bbaf3 (patch)
tree0c7f44dbea98f14e8d4a5b6349883e21ed1d940a /src
parent9589f4fff5c3b9e1b521762f48aec2539c556c6d (diff)
downloadhercules-3119f6e757ec0c0b43a312954a5a3c09b27bbaf3.tar.gz
hercules-3119f6e757ec0c0b43a312954a5a3c09b27bbaf3.tar.bz2
hercules-3119f6e757ec0c0b43a312954a5a3c09b27bbaf3.tar.xz
hercules-3119f6e757ec0c0b43a312954a5a3c09b27bbaf3.zip
Fixed a possile buffer overrun when MAX_SKILL_LEVEL is changed
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/map/skill.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 561154bdf..5e32e922c 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -18995,7 +18995,7 @@ void skill_config_set_level(struct config_setting_t *conf, int *arr)
if (config_setting_is_group(conf)) {
for (i=0; i<MAX_SKILL_LEVEL; i++) {
- char level[5];
+ char level[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL
sprintf(level, "Lv%d", i+1);
libconfig->setting_lookup_int(conf, level, &arr[i]);
}
@@ -19259,7 +19259,7 @@ void skill_validate_element(struct config_setting_t *conf, struct s_skill_db *sk
if ((t=libconfig->setting_get_member(conf, "Element")) && config_setting_is_group(t)) {
int j = 0;
- char lv[5];
+ char lv[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL
for (j=0; j < MAX_SKILL_LEVEL; j++) {
sprintf(lv, "Lv%d",j+1);