[SCM] PostGIS branch stable-3.5 updated. 3.5.4-12-g3ec8542a9
git at osgeo.org
git at osgeo.org
Tue Jan 13 07:32:47 PST 2026
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 3ec8542a9ca9b3a6edcb662731108e22f1779b91 (commit)
from 9edefcf512798655375eb7ae6a0820546f1d45c9 (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 3ec8542a9ca9b3a6edcb662731108e22f1779b91
Author: Sandro Santilli <strk at kbt.io>
Date: Tue Jan 13 12:05:57 2026 +0100
Fix robustness issue in ptarray_contains_point
References #6023 in 3.5 branch (3.5.5dev)
Includes unit test
diff --git a/NEWS b/NEWS
index 8aef123f7..3acc169ad 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-PostGIS 3.5.5
+PostGIS 3.5.5dev
xxxx/xx/xx
To take advantage of all postgis_sfcgal extension features SFCGAL 1.5+ is needed.
@@ -8,6 +8,7 @@ PostgreSQL 12-18 required. GEOS 3.8+ required. Proj 6.1+ required.
- #5959, #5984, Prevent histogram target overflow when analysing massive tables (Darafei Praliaskouski)
- #6020, schema qualify call in ST_MPointFromText (Paul Ramsey)
+ - #6023, Fix robustness issue in ptarray_contains_point (Sandro Santilli)
- #6027, Fix RemoveUnusedPrimitives without topology in search_path (Sandro Santilli)
- #6028, crash indexing malformed empty polygon (Paul Ramsey)
diff --git a/liblwgeom/cunit/cu_ptarray.c b/liblwgeom/cunit/cu_ptarray.c
index bfb830284..bb1f43925 100644
--- a/liblwgeom/cunit/cu_ptarray.c
+++ b/liblwgeom/cunit/cu_ptarray.c
@@ -426,6 +426,17 @@ static void test_ptarray_contains_point()
rv = ptarray_contains_point(pa, &pt);
CU_ASSERT_EQUAL(rv, LW_INSIDE);
+ lwline_free(lwline);
+
+
+ /* Test for https://trac.osgeo.org/postgis/ticket/6023 */
+ lwline = lwgeom_as_lwline(lwgeom_from_text("LINESTRING(11.230120879533454 62.84897119848748,11.230120879533905 62.8489711984873,11.23020501303477 62.84900750109812,11.230170431987244 62.84904481447776,11.230117909393426 62.8489943480894,11.230120879533454 62.84897119848748)"));
+ pa = lwline->points;
+ pt = getPoint2d(lwline->points, 0);
+ rv = ptarray_contains_point(pa, &pt);
+ ASSERT_INT_EQUAL(rv, LW_BOUNDARY);
+
+
lwline_free(lwline);
}
diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
index 2369bff18..7a5cf234a 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -768,6 +768,12 @@ ptarray_contains_point(const POINTARRAY *pa, const POINT2D *pt)
seg2 = getPoint2d_cp(pa, i);
+ /* This is required for robustness, see #6023 */
+ if (p2d_same(seg1, pt))
+ {
+ return LW_BOUNDARY;
+ }
+
/* Zero length segments are ignored. */
if (p2d_same(seg1, seg2))
{
-----------------------------------------------------------------------
Summary of changes:
NEWS | 3 ++-
liblwgeom/cunit/cu_ptarray.c | 11 +++++++++++
liblwgeom/ptarray.c | 6 ++++++
3 files changed, 19 insertions(+), 1 deletion(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list