summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/script.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 1dff4c202..1b441cabd 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -7352,7 +7352,8 @@ BUILDIN(strnpcinfo) {
name = aStrdup(nd->exname);
break;
case 4: // map name
- name = aStrdup(map->list[nd->bl.m].name);
+ if( nd->bl.m >= 0 ) // Only valid map indexes allowed (issue:8034)
+ name = aStrdup(map->list[nd->bl.m].name);
break;
}