[SCM] PostGIS branch master updated. 3.6.0rc2-67-ga89de1646

git at osgeo.org git at osgeo.org
Tue Sep 30 10:59:19 PDT 2025


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  a89de164624f1a9024d7912107cd9e6662f0cadb (commit)
      from  ecfb41a80c3c01e67a76ff264aba9a89bb0a03c3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a89de164624f1a9024d7912107cd9e6662f0cadb
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Sep 30 10:29:37 2025 -0700

    Fix null pointer in ST_AsGeoJsonRow, references #5994

diff --git a/postgis/lwgeom_out_geojson.c b/postgis/lwgeom_out_geojson.c
index 86f6b48c9..0338cdf18 100644
--- a/postgis/lwgeom_out_geojson.c
+++ b/postgis/lwgeom_out_geojson.c
@@ -86,12 +86,12 @@ ST_AsGeoJsonRow(PG_FUNCTION_ARGS)
 {
 	Datum		array = PG_GETARG_DATUM(0);
 	text        *geom_column_text = PG_GETARG_TEXT_P(1);
+	char        *geom_column = PG_ARGISNULL(1) ? "" : text_to_cstring(geom_column_text);
 	int32       maxdecimaldigits = PG_GETARG_INT32(2);
 	bool		do_pretty = PG_GETARG_BOOL(3);
 	text        *id_column_text = PG_GETARG_TEXT_P(4);
-	StringInfo	result;
-	char        *geom_column = text_to_cstring(geom_column_text);
-	char        *id_column = text_to_cstring(id_column_text);
+	char        *id_column = PG_ARGISNULL(4) ? "" : text_to_cstring(id_column_text);
+	StringInfoData result;
 	Oid geom_oid = InvalidOid;
 	Oid geog_oid = InvalidOid;
 
@@ -105,11 +105,11 @@ ST_AsGeoJsonRow(PG_FUNCTION_ARGS)
 	if (strlen(id_column) == 0)
 		id_column = NULL;
 
-	result = makeStringInfo();
+	initStringInfo(&result);
 
-	composite_to_geojson(fcinfo, array, geom_column, id_column, maxdecimaldigits, result, do_pretty, geom_oid, geog_oid);
+	composite_to_geojson(fcinfo, array, geom_column, id_column, maxdecimaldigits, &result, do_pretty, geom_oid, geog_oid);
 
-	PG_RETURN_TEXT_P(cstring_to_text_with_len(result->data, result->len));
+	PG_RETURN_TEXT_P(cstring_to_text_with_len(result.data, result.len));
 }
 
 /*

-----------------------------------------------------------------------

Summary of changes:
 postgis/lwgeom_out_geojson.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list