[SCM] PostGIS branch stable-3.3 updated. 3.3.7-65-g29d977fa4

git at osgeo.org git at osgeo.org
Tue Jan 13 07:34:32 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.3 has been updated
       via  29d977fa49f899bfe6533bd2fe8b14a13b1313d3 (commit)
      from  38c2ccb5ea604ac456e3297be39663d0cbbce58e (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 29d977fa49f899bfe6533bd2fe8b14a13b1313d3
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.3 branch (3.3.9dev)
    
    Includes unit test

diff --git a/NEWS b/NEWS
index cd969c30f..a2005d6a9 100644
--- a/NEWS
+++ b/NEWS
@@ -26,6 +26,7 @@ Proj 4.9+ required.
  - #5991, CircularString distance error (Paul Ramsey)
  - #5962, Consistent clipping of MULTI/POINT (Paul Ramsey)
  - #5989, CurvePolygon distance error (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 48d6a3b24..82c50301d 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 e106d2372..4d822fb98 100644
--- a/liblwgeom/ptarray.c
+++ b/liblwgeom/ptarray.c
@@ -759,6 +759,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                         |  1 +
 liblwgeom/cunit/cu_ptarray.c | 11 +++++++++++
 liblwgeom/ptarray.c          |  6 ++++++
 3 files changed, 18 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list