[mapserver-commits] r10056 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Tue Apr 6 16:03:32 EDT 2010


Author: aboudreault
Date: 2010-04-06 16:03:31 -0400 (Tue, 06 Apr 2010)
New Revision: 10056

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapprimitive.c
   trunk/mapserver/mapshape.c
Log:
Fixed segfault when using shapefile with empty geometry and tileindex (#3365)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2010-04-06 18:55:20 UTC (rev 10055)
+++ trunk/mapserver/HISTORY.TXT	2010-04-06 20:03:31 UTC (rev 10056)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- Fixed segfault when using shapefile with empty geometry and tileindex (#3365)
+
 - Avoid race condition on core_lock on win32 mutex init (#3396)
 
 - Avoid use of inline keyword for C code (#3327)

Modified: trunk/mapserver/mapprimitive.c
===================================================================
--- trunk/mapserver/mapprimitive.c	2010-04-06 18:55:20 UTC (rev 10055)
+++ trunk/mapserver/mapprimitive.c	2010-04-06 20:03:31 UTC (rev 10056)
@@ -148,8 +148,8 @@
 
   for (c= 0; c < shape->numlines; c++)
     free(shape->line[c].point);
-  free(shape->line);
 
+  if (shape->line) free(shape->line);
   if(shape->values) msFreeCharArray(shape->values, shape->numvalues);
   if(shape->text) free(shape->text);
   

Modified: trunk/mapserver/mapshape.c
===================================================================
--- trunk/mapserver/mapshape.c	2010-04-06 18:55:20 UTC (rev 10055)
+++ trunk/mapserver/mapshape.c	2010-04-06 20:03:31 UTC (rev 10056)
@@ -1327,6 +1327,7 @@
         while(--i >= 0)
           free(shape->line[i].point);
         free(shape->line);
+        shape->line = NULL;
         shape->numlines = 0;
         shape->type = MS_SHAPE_NULL;
         return;



More information about the mapserver-commits mailing list