Skip to content

Commit

Permalink
fix a possible buffer overflow when using custom MAX_SKILL_LEVEL
Browse files Browse the repository at this point in the history
  • Loading branch information
guilherme-gm committed Oct 8, 2023
1 parent 6924dc5 commit e03fe88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/map/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -21645,7 +21645,7 @@ static 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[6]; // enough to contain "Lv100" in case of custom MAX_SKILL_LEVEL
sprintf(level, "Lv%d", i+1);
snprintf(level, sizeof(level), "Lv%d", i + 1);
libconfig->setting_lookup_int(conf, level, &arr[i]);
}
} else if (config_setting_is_array(conf)) {
Expand Down

0 comments on commit e03fe88

Please sign in to comment.