summaryrefslogtreecommitdiff
path: root/src/map/instance.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-08-20 18:55:56 +0200
committerHaru <haru@dotalux.com>2013-08-20 18:59:59 +0200
commit4a9c55a77daa478b9f994d5a1b06619104b82982 (patch)
tree144817a938ca4e3756e0bbdbaf327cc7632a5631 /src/map/instance.c
parentac131bf1baa9a8f9a87176beadf1ce4ebd8abb01 (diff)
downloadhercules-4a9c55a77daa478b9f994d5a1b06619104b82982.tar.gz
hercules-4a9c55a77daa478b9f994d5a1b06619104b82982.tar.bz2
hercules-4a9c55a77daa478b9f994d5a1b06619104b82982.tar.xz
hercules-4a9c55a77daa478b9f994d5a1b06619104b82982.zip
Fixed a mapserver crash when using instanced maps with custom names
- Fixes bugreport:7658 (thanks to purityz) http://hercules.ws/board/tracker/issue-7658-instance-mapserver-crashing/ - The crash was caused by a pointer becoming invalid when reallocating map[] (i.e. when adding maps), since 20bdc01f Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/instance.c')
-rw-r--r--src/map/instance.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/instance.c b/src/map/instance.c
index 84c0bd8e2..4e145fb8f 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -179,7 +179,7 @@ int instance_add_map(const char *name, int instance_id, bool usebasename, const
memcpy( &map[im], &map[m], sizeof(struct map_data) ); // Copy source map
if( map_name != NULL ) {
snprintf(map[im].name, MAP_NAME_LENGTH, "%s", map_name);
- map[im].cName = map[m].name;
+ map[im].custom_name = true;
} else
snprintf(map[im].name, MAP_NAME_LENGTH, (usebasename ? "%.3d#%s" : "%.3d%s"), instance_id, name); // Generate Name for Instance Map
map[im].index = mapindex_addmap(-1, map[im].name); // Add map index