[SCM] PostGIS branch stable-3.5 updated. 3.5.3-56-g50caad929
git at osgeo.org
git at osgeo.org
Tue Sep 30 10:59:12 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.5 has been updated
via 50caad929fce9d57ff633da75e29575b692acaa0 (commit)
via 6635922a3693a03e5555e24bf067fec582a621ce (commit)
from 6085536df194f697887048f3c5d80e2b57107c8f (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 50caad929fce9d57ff633da75e29575b692acaa0
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Sep 30 10:37:09 2025 -0700
News item for #5994
diff --git a/NEWS b/NEWS
index 683887ff9..67e50c200 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required.
- #5082, LRS proportions clamped to [0,1] (Pawel Ostrowski)
- #5985, Fix configure issue with Debian 12 and 13 (Regina Obe, Sandro Santilli)
- #5991, CircularString distance error (Paul Ramsey)
+- #5994, Null pointer in ST_AsGeoJsonRow (Alexander Kukushkin)
PostGIS 3.5.3
commit 6635922a3693a03e5555e24bf067fec582a621ce
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 67c1cafa6..931344c1c 100644
--- a/postgis/lwgeom_out_geojson.c
+++ b/postgis/lwgeom_out_geojson.c
@@ -88,12 +88,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;
@@ -107,11 +107,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