[postgis-tickets] r14431 - fix crash in remove repeated points, ref #3375

Paul Ramsey pramsey at cleverelephant.ca
Wed Nov 25 13:49:01 PST 2015


Author: pramsey
Date: 2015-11-25 13:49:01 -0800 (Wed, 25 Nov 2015)
New Revision: 14431

Modified:
   branches/2.0/NEWS
   branches/2.0/liblwgeom/lwgeom.c
Log:
fix crash in remove repeated points, ref #3375


Modified: branches/2.0/NEWS
===================================================================
--- branches/2.0/NEWS	2015-11-25 21:45:50 UTC (rev 14430)
+++ branches/2.0/NEWS	2015-11-25 21:49:01 UTC (rev 14431)
@@ -12,6 +12,7 @@
   - #3155, Remove liblwgeom.h on make uninstall
   - #3359, Fix toTopoGeom loss of low-id primitives from TopoGeometry
            definition
+  - #3375, crash in remove repeated points
 
 
 PostGIS 2.0.7

Modified: branches/2.0/liblwgeom/lwgeom.c
===================================================================
--- branches/2.0/liblwgeom/lwgeom.c	2015-11-25 21:45:50 UTC (rev 14430)
+++ branches/2.0/liblwgeom/lwgeom.c	2015-11-25 21:49:01 UTC (rev 14431)
@@ -1259,7 +1259,7 @@
 	case TRIANGLETYPE:
 	case TINTYPE:
 		/* No point is repeated for a single point, or for Triangle or TIN */
-		return in;
+		return lwgeom_clone_deep(in);
 
 	case CIRCSTRINGTYPE:
 	case COMPOUNDTYPE:
@@ -1267,12 +1267,12 @@
 	case CURVEPOLYTYPE:
 	case MULTISURFACETYPE:
 		/* Dunno how to handle these, will return untouched */
-		return in;
+		return lwgeom_clone_deep(in);
 
 	default:
 		lwnotice("lwgeom_remove_repeated_points: unsupported geometry type: %s",
 		         lwtype_name(in->type));
-		return in;
+ 		return lwgeom_clone_deep(in);
 		break;
 	}
 	return 0;



More information about the postgis-tickets mailing list