[SCM] PostGIS branch stable-3.4 updated. 3.4.4-29-g9578b9e81

git at osgeo.org git at osgeo.org
Thu Jun 5 19:30:41 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.4 has been updated
       via  9578b9e81382e1d24f4be07056bafeb7ec127406 (commit)
       via  9ed7be2f4e2d98630e628eaa8f68dbc903b517c7 (commit)
      from  0fb1d7af7854a63ff18302bb7966e4471eedf0d6 (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 9578b9e81382e1d24f4be07056bafeb7ec127406
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Thu Jun 5 19:30:28 2025 -0700

    News item for #5905

diff --git a/NEWS b/NEWS
index 2f5eb9052..cdf98100f 100644
--- a/NEWS
+++ b/NEWS
@@ -19,7 +19,7 @@ Proj 6.1+ required.
   - #5885, Fix documentation about grid-based overlay operations (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.4.4
 2024/12/22

commit 9ed7be2f4e2d98630e628eaa8f68dbc903b517c7
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 e096bf3a7..694f6d058 100644
--- a/postgis/lwgeom_dump.c
+++ b/postgis/lwgeom_dump.c
@@ -182,6 +182,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 7bbd95ad6..0df543c55 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);
@@ -486,6 +490,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                        | 2 +-
 postgis/lwgeom_dump.c       | 3 +++
 postgis/lwgeom_dumppoints.c | 7 +++++++
 3 files changed, 11 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list