From d0725afa8363b5f7b0612e087b48013d39339039 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Sun, 18 Jan 2015 11:37:45 -0200 Subject: Fixing 38 issues Addressing out of bounds read/write, pointless null checks on already deferenced variables, dead code. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind --- src/map/npc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/map/npc.c') diff --git a/src/map/npc.c b/src/map/npc.c index 38ba9ae41..c00094f8c 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3876,7 +3876,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char map->list[m].flag.nomvploot=state; else if (!strcmpi(w3,"nocommand")) { if (state) { - if (sscanf(w4, "%d", &state) == 1) + if (w4 && sscanf(w4, "%d", &state) == 1) map->list[m].nocommand =state; else //No level specified, block everyone. map->list[m].nocommand =100; @@ -4113,7 +4113,6 @@ int npc_parsesrcfile(const char* filepath, bool runOnInit) { // More info at http://unicode.org/faq/utf_bom.html#bom5 and http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8 ShowError("npc_parsesrcfile: Detected unsupported UTF-8 BOM in file '%s'. Stopping (please consider using another character set.)\n", filepath); aFree(buffer); - fclose(fp); return EXIT_FAILURE; } -- cgit v1.2.3-60-g2f50