[SCM] PostGIS branch stable-3.2 updated. 3.2.7-25-g310a06e40

git at osgeo.org git at osgeo.org
Mon Apr 7 12:51:23 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  310a06e40005504b98ba929dac2ce7d6e9edb88a (commit)
      from  4fbbfb913a823695fd7c344be7d9a79349faf8d8 (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 310a06e40005504b98ba929dac2ce7d6e9edb88a
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Mon Apr 7 12:51:00 2025 -0700

    Fix ST_AddPoint with empty point argument
    References #5876

diff --git a/NEWS b/NEWS
index 0c11ee452..36997da25 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,9 @@ Proj 4.9+ required.
 
 * Bug Fixes  *
 
+ - #5876, Fix ST_AddPoint with empty point argument (Paul Ramsey)
+
+
 PostGIS 3.2.8
 2024/12/22
 
diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c
index 313a767aa..db5516b7d 100644
--- a/liblwgeom/lwgeom_api.c
+++ b/liblwgeom/lwgeom_api.c
@@ -108,7 +108,8 @@ POINT4D
 getPoint4d(const POINTARRAY *pa, uint32_t n)
 {
 	POINT4D result;
-	getPoint4d_p(pa, n, &result);
+	if (getPoint4d_p(pa, n, &result) == 0)
+		lwerror("%s [%d] error returned by getPoint4d_p", __FILE__, __LINE__);
 	return result;
 }
 
@@ -135,7 +136,7 @@ getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *op)
 
 	if ( n>=pa->npoints )
 	{
-		lwnotice("%s [%d] called with n=%d and npoints=%d", __FILE__, __LINE__, n, pa->npoints);
+		lwerror("%s [%d] called with n=%d and npoints=%d", __FILE__, __LINE__, n, pa->npoints);
 		return 0;
 	}
 
diff --git a/postgis/lwgeom_functions_basic.c b/postgis/lwgeom_functions_basic.c
index 1a872aa94..f61aeb133 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2325,6 +2325,11 @@ Datum LWGEOM_addpoint(PG_FUNCTION_ARGS)
 		PG_RETURN_NULL();
 	}
 
+	if (gserialized_is_empty(pglwg2))
+	{
+		PG_RETURN_POINTER(pglwg1);
+	}
+
 	line = lwgeom_as_lwline(lwgeom_from_gserialized(pglwg1));
 
 	if (PG_NARGS() <= 2)

-----------------------------------------------------------------------

Summary of changes:
 NEWS                             | 3 +++
 liblwgeom/lwgeom_api.c           | 5 +++--
 postgis/lwgeom_functions_basic.c | 5 +++++
 3 files changed, 11 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list