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

Daniel Baston dbaston at gmail.com
Thu Dec 3 16:07:46 PST 2015


Author: dbaston
Date: 2015-12-03 16:07:45 -0800 (Thu, 03 Dec 2015)
New Revision: 14476

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

Modified: branches/2.1/liblwgeom/lwout_geojson.c
===================================================================
--- branches/2.1/liblwgeom/lwout_geojson.c	2015-12-03 23:57:11 UTC (rev 14475)
+++ branches/2.1/liblwgeom/lwout_geojson.c	2015-12-04 00:07:45 UTC (rev 14476)
@@ -260,7 +260,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