[SCM] PostGIS branch stable-3.6 updated. 3.6.0-8-g9161e9486

git at osgeo.org git at osgeo.org
Tue Sep 30 10:59:15 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, stable-3.6 has been updated
       via  9161e94863560ddec2768e57a6ba3b4790c52a32 (commit)
       via  c8043098d6700d5b67b3ed5d63eadcb67f3e4ed3 (commit)
      from  db18a9a491da8748e8f214ad69d4e72f6627ec20 (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 9161e94863560ddec2768e57a6ba3b4790c52a32
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Tue Sep 30 10:35:24 2025 -0700

    News item for #5994

diff --git a/NEWS b/NEWS
index cd2c5dbf3..f65470d6f 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PostGIS 3.6.1
   - #5978, geometry_columns needs to still parse table constraints (Paul Ramsey)
   - #5987, ST_GeometryN fails for non-collections (Paul Ramsey)  
   - #5991, CircularString distance error (Paul Ramsey)
+  - #5994, Null pointer in ST_AsGeoJsonRow (Alexander Kukushkin)
 
 
 PostGIS 3.6.0

commit c8043098d6700d5b67b3ed5d63eadcb67f3e4ed3
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:
 NEWS                         |  1 +
 postgis/lwgeom_out_geojson.c | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list