summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2015-01-17 20:18:49 -0200
committershennetsind <ind@henn.et>2015-01-17 20:18:49 -0200
commita3c4d675ba19df385be5d1e3966c61de7186da57 (patch)
tree45b4a026a758afb1a54387cdadb91d55eba621f8 /src/map/npc.c
parent3e53a34615c2535dbed3d7c2c7a00f1ef3eaff0a (diff)
downloadhercules-a3c4d675ba19df385be5d1e3966c61de7186da57.tar.gz
hercules-a3c4d675ba19df385be5d1e3966c61de7186da57.tar.bz2
hercules-a3c4d675ba19df385be5d1e3966c61de7186da57.tar.xz
hercules-a3c4d675ba19df385be5d1e3966c61de7186da57.zip
27 Fixes
Addressing out of bounds read/write, pointless null checks on already deferenced variables. Special Thanks to 4144 and Haruna! Signed-off-by: shennetsind <ind@henn.et>
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 8ecefb5a0..38ba9ae41 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -3683,7 +3683,7 @@ const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, const char
map->list[m].save.map = 0;
map->list[m].save.x = -1;
map->list[m].save.y = -1;
- } else if (sscanf(w4, "%31[^,],%d,%d", savemap, &savex, &savey) == 3) {
+ } else if (w4 && sscanf(w4, "%31[^,],%d,%d", savemap, &savex, &savey) == 3) {
map->list[m].save.map = mapindex->name2id(savemap);
map->list[m].save.x = savex;
map->list[m].save.y = savey;