[SCM] PostGIS branch stable-3.5 updated. 3.5.3-10-g4bde0abba
git at osgeo.org
git at osgeo.org
Thu Jun 5 19:30:37 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 4bde0abba024af5a1597e75024270f1980787cc8 (commit)
via ef5772764cf7deefb71bffa8b130ea153687093f (commit)
from 05dc210b7f166cec21688756bec203a5134b3853 (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 4bde0abba024af5a1597e75024270f1980787cc8
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Thu Jun 5 19:29:50 2025 -0700
News item for #5905
diff --git a/NEWS b/NEWS
index 151891cfa..d42cb9c26 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required.
- #5922, [topology] Fix crash in TopoGeo_AddLinestring with EMPTY input (Sandro Santilli)
- #5921, Crash freeing uninitialized pointer (Arsenii Mukhin)
- #5912, Crash on GML with xlink and no prefix (Paul Ramsey)
+- #5905, Crash on deeply nested geometries (Paul Ramsey)
PostGIS 3.5.3
commit ef5772764cf7deefb71bffa8b130ea153687093f
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Thu Jun 5 18:23:07 2025 -0700
Guard against overly nested collections in dump functions, references #5905
diff --git a/postgis/lwgeom_dump.c b/postgis/lwgeom_dump.c
index 7933851e5..6ce3bcb14 100644
--- a/postgis/lwgeom_dump.c
+++ b/postgis/lwgeom_dump.c
@@ -180,6 +180,9 @@ Datum LWGEOM_dump(PG_FUNCTION_ARGS)
* stack
*/
+ if (state->stacklen > MAXDEPTH)
+ elog(ERROR, "Unable to dump overly nested collection.");
+
oldcontext = MemoryContextSwitchTo(newcontext);
node = lwalloc(sizeof(GEOMDUMPNODE));
diff --git a/postgis/lwgeom_dumppoints.c b/postgis/lwgeom_dumppoints.c
index 4fc0e3f9d..aef606116 100644
--- a/postgis/lwgeom_dumppoints.c
+++ b/postgis/lwgeom_dumppoints.c
@@ -272,6 +272,10 @@ Datum LWGEOM_dumppoints(PG_FUNCTION_ARGS) {
/* if a collection and we have more geoms */
if (node->idx < lwcoll->ngeoms) {
+
+ if(state->stacklen >= MAXDEPTH)
+ elog(ERROR, "Unabled to dump overly nested collection");
+
/* push the next geom on the path and the stack */
lwgeom = lwcoll->geoms[node->idx++];
state->path[state->pathlen++] = Int32GetDatum(node->idx);
@@ -494,6 +498,9 @@ Datum LWGEOM_dumpsegments(PG_FUNCTION_ARGS)
/* if a collection and we have more geoms */
if (node->idx < lwcoll->ngeoms)
{
+ if (state->stacklen > MAXDEPTH)
+ elog(ERROR, "Unable to dump overly nested collection");
+
/* push the next geom on the path and the stack */
lwgeom = lwcoll->geoms[node->idx++];
state->path[state->pathlen++] = Int32GetDatum(node->idx);
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
postgis/lwgeom_dump.c | 3 +++
postgis/lwgeom_dumppoints.c | 7 +++++++
3 files changed, 11 insertions(+)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list