summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-08 19:41:38 +0300
committerHaru <haru@dotalux.com>2014-09-08 20:05:49 +0200
commite785879df0519ee69afcac34a1b49db1462d67fc (patch)
tree64abf1147cd3015eac152c25ac6312eced6e5933 /src/map/npc.c
parentd8a93ff67917fdc02f2539ba6f03edc09870f535 (diff)
downloadhercules-e785879df0519ee69afcac34a1b49db1462d67fc.tar.gz
hercules-e785879df0519ee69afcac34a1b49db1462d67fc.tar.bz2
hercules-e785879df0519ee69afcac34a1b49db1462d67fc.tar.xz
hercules-e785879df0519ee69afcac34a1b49db1462d67fc.zip
Fix on start possible buffer overruns.
Checks after using --enable-sanitize.
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index f1c6f4fbd..f4f20a60d 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3447,7 +3447,7 @@ const char* npc_parse_mob(char* w1, char* w2, char* w3, char* w4, const char* st
// w4=<mob id>,<amount>,<delay1>,<delay2>,<event>{,<mob size>,<mob ai>}
if( sscanf(w1, "%31[^,],%d,%d,%d,%d", mapname, &x, &y, &xs, &ys) < 3
|| sscanf(w3, "%23[^,],%d", mobname, &mob_lv) < 1
- || sscanf(w4, "%d,%d,%u,%u,%127[^,],%d,%d[^\t\r\n]", &class_, &num, &mobspawn.delay1, &mobspawn.delay2, mobspawn.eventname, &size, &ai) < 2
+ || sscanf(w4, "%d,%d,%u,%u,%50[^,],%d,%d[^\t\r\n]", &class_, &num, &mobspawn.delay1, &mobspawn.delay2, mobspawn.eventname, &size, &ai) < 2
) {
ShowError("npc_parse_mob: Invalid mob definition in file '%s', line '%d'.\n * w1=%s\n * w2=%s\n * w3=%s\n * w4=%s\n", filepath, strline(buffer,start-buffer), w1, w2, w3, w4);
if (retval) *retval = EXIT_FAILURE;