[SCM] PostGIS branch stable-3.2 updated. 3.2.7-40-g88037f692
git at osgeo.org
git at osgeo.org
Thu Jun 5 19:32:38 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.2 has been updated
via 88037f6928621c4a196e027454dce4f7ac562e4c (commit)
via b786037088da3c8e7444ebbc751d84ba253fbe2e (commit)
from 35429f81f1b9dd469494e575552542a757efe847 (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 88037f6928621c4a196e027454dce4f7ac562e4c
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Thu Jun 5 19:32:33 2025 -0700
News item for #5905
diff --git a/NEWS b/NEWS
index 6c04a03d4..983a6ea4c 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Proj 4.9+ 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.2.8
2024/12/22
commit b786037088da3c8e7444ebbc751d84ba253fbe2e
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 | 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