[SCM] PostGIS branch stable-3.4 updated. 3.4.4-40-g643ab1090
git at osgeo.org
git at osgeo.org
Fri Jul 25 00:54:32 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 643ab10904f47dce8ea6f327d891289877e5a03d (commit)
from 59d868631813590b6c0cb7540a9ff7aede98ae5d (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 643ab10904f47dce8ea6f327d891289877e5a03d
Author: Sandro Santilli <strk at kbt.io>
Date: Fri Jul 25 09:37:39 2025 +0200
Fix crash in ST_GetFaceEdges with corrupted topology
References #5951 in 3.4 branch (3.4.5dev)
diff --git a/NEWS b/NEWS
index 4d1320fb6..1af726707 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Proj 6.1+ required.
* Bug Fixes *
- #5947, [topology] Fix crash in ST_ModEdgeHeal (Sandro Santilli)
+ - #5951, [topology] Fix crash in ST_GetFaceEdges with corrupted topology (Sandro Santilli)
- #5925, #5946, [topology] Have GetFaceContainingPoint survive EMPTY edges (Sandro Santilli)
- #5936, [topology] Do script-based upgrade in a single transaction (Sandro Santilli)
- #5922, [topology] Fix crash in TopoGeo_AddLinestring with EMPTY input (Sandro Santilli)
diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
index b582baff4..eb72fb92a 100644
--- a/liblwgeom/lwgeom_topo.c
+++ b/liblwgeom/lwgeom_topo.c
@@ -3129,6 +3129,8 @@ lwt_GetFaceEdges(LWT_TOPOLOGY* topo, LWT_ELEMID face_id, LWT_ELEMID **out )
{
/* _lwt_FaceByEdges should have already invoked lwerror in this case */
_lwt_release_edges(edges, numfaceedges);
+ lwerror("Corrupted topology: unable to build geometry of face %"
+ LWTFMT_ELEMID " from its %llu edges", face_id, numfaceedges);
return -1;
}
diff --git a/topology/postgis_topology.c b/topology/postgis_topology.c
index 2b31cabe4..7acff22f9 100644
--- a/topology/postgis_topology.c
+++ b/topology/postgis_topology.c
@@ -4220,6 +4220,10 @@ Datum ST_GetFaceEdges(PG_FUNCTION_ARGS)
/* get state */
state = funcctx->user_fctx;
+ if ( ! state )
+ {
+ SRF_RETURN_DONE(funcctx);
+ }
if ( state->curr == state->nelems )
{
diff --git a/topology/test/regress/st_getfaceedges.sql b/topology/test/regress/st_getfaceedges.sql
index 6ff65b468..356ba1faf 100644
--- a/topology/test/regress/st_getfaceedges.sql
+++ b/topology/test/regress/st_getfaceedges.sql
@@ -41,4 +41,15 @@ SELECT '#3265.3', 'E'||topology.TopoGeo_addLinestring('tt',
SELECT '#3265.4', 0, ST_GetFaceEdges('tt', 0);
SELECT '#3265.5', 1, ST_GetFaceEdges('tt', 1);
SELECT '#3265.6', 2, ST_GetFaceEdges('tt', 2);
-SELECT topology.DropTopology('tt');
+SELECT NULL FROM topology.DropTopology('tt');
+
+-- See https://trac.osgeo.org/postgis/ticket/5951
+SELECT NULL FROM topology.CreateTopology('t5951');
+SELECT NULL FROM topology.TopoGeo_addLinestring('t5951', 'LINESTRING(0 0, 10 0)');
+SELECT NULL FROM topology.TopoGeo_addLinestring('t5951', 'LINESTRING(0 0, 5 5)');
+SELECT NULL FROM topology.TopoGeo_addLinestring('t5951', 'LINESTRING(5 5, 10 0)');
+SELECT NULL FROM topology.TopoGeo_addLinestring('t5951', 'LINESTRING(5 5, 10 5)');
+SELECT NULL FROM topology.TopoGeo_addLinestring('t5951', 'LINESTRING(10 0, 10 5)');
+UPDATE t5951.edge_data SET left_face = 0, right_face = 0 WHERE edge_id = 3;
+SELECT '#5951.1', topology.ST_GetFaceEdges('t5951', face_id) FROM t5951.face WHERE face_id > 0;
+SELECT NULL FROM topology.DropTopology('t5951');
-----------------------------------------------------------------------
Summary of changes:
NEWS | 1 +
liblwgeom/lwgeom_topo.c | 2 ++
topology/postgis_topology.c | 4 ++++
topology/test/regress/st_getfaceedges.sql | 13 ++++++++++++-
4 files changed, 19 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list