From 4a9c55a77daa478b9f994d5a1b06619104b82982 Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 20 Aug 2013 18:55:56 +0200 Subject: 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 --- src/map/instance.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/map/instance.c') 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 -- cgit v1.2.3-60-g2f50