- #1819, fix floating point issues with ST_World2RasterCoord and
ST_Raster2WorldCoord variants.
- #1825, fix prepared geometry cache lookup
+ - #1829, fix uninitialized read in GeoJSON parser
* Enhancements *
pt.y = json_object_get_int( poObjCoord );
POSTGIS_DEBUGF(3, "parse_geojson_coord pt.y = %f.", pt.y );
- *hasz = false;
-
- if( nSize == 3 )
+ if( nSize == 3 ) /* should this be >= 3 ? */
{
// Read Z coordiante
poObjCoord = json_object_array_get_idx( poObj, 2 );
POSTGIS_DEBUGF(3, "parse_geojson_coord pt.z = %f.", pt.z );
*hasz = true;
}
+ else
+ {
+ *hasz = false;
+ /* Initialize Z coordinate, if required */
+ if ( FLAGS_GET_Z(pa->flags) ) pt.z = 0.0;
+ }
+
+ /* TODO: should we account for nSize > 3 ? */
+
+ /* Initialize M coordinate, if required */
+ if ( FLAGS_GET_M(pa->flags) ) pt.m = 0.0;
+
}
return ptarray_append_point(pa, &pt, LW_FALSE);