[postgis-tickets] r14474 - #3389, buffer overflow in lwgeom_to_geojson

Daniel Baston dbaston at gmail.com
Thu Dec 3 15:48:04 PST 2015


Author: dbaston
Date: 2015-12-03 15:48:04 -0800 (Thu, 03 Dec 2015)
New Revision: 14474

Modified:
   trunk/liblwgeom/lwout_geojson.c
Log:
#3389, buffer overflow in lwgeom_to_geojson

Modified: trunk/liblwgeom/lwout_geojson.c
===================================================================
--- trunk/liblwgeom/lwout_geojson.c	2015-12-03 18:48:14 UTC (rev 14473)
+++ trunk/liblwgeom/lwout_geojson.c	2015-12-03 23:48:04 UTC (rev 14474)
@@ -259,7 +259,7 @@
 	if (srs) size += asgeojson_srs_size(srs);
 	if (bbox) size += asgeojson_bbox_size(FLAGS_GET_Z(poly->flags), precision);
 	size += sizeof("\"coordinates\":[");
-	for (i=0, size=0; i<poly->nrings; i++)
+	for (i=0; i<poly->nrings; i++)
 	{
 		size += pointArray_geojson_size(poly->rings[i], precision);
 		size += sizeof("[]");



More information about the postgis-tickets mailing list