From 51241f66ad6e78cf56b91c41e524c00a1d5abeb2 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 21 Sep 2013 03:47:19 +0200 Subject: Fixed a potentially negative array subscript causing a mapserver crash - Fixes bugreport:7717, special thanks to quesoph http://hercules.ws/board/tracker/issue-7717-map-crash-when-warping-on-a-floating-npc/ - Also changed various map[foo].index to the map_id2index(foo) macro. Signed-off-by: Haru --- src/map/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map/map.c') diff --git a/src/map/map.c b/src/map/map.c index d4568766a..865682afc 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -3167,7 +3167,7 @@ int map_readallmaps (void) { map[i].index = mapindex_name2id(map[i].name); - if ( index2mapid[map[i].index] != -1 ) { + if ( index2mapid[map_id2index(i)] != -1 ) { ShowWarning("Map %s already loaded!"CL_CLL"\n", map[i].name); if (map[i].cell && map[i].cell != (struct mapcell *)0xdeadbeaf) { aFree(map[i].cell); -- cgit v1.2.3-60-g2f50