[SCM] PostGIS branch stable-3.3 updated. 3.3.7-18-gd7512e548
git at osgeo.org
git at osgeo.org
Mon Apr 7 12:45: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.3 has been updated
via d7512e548573e8bc3f9b999c78362c4e4c5bcec4 (commit)
from aaf02e1c91415a82c51b1e02093a5e775b3a9d1b (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 d7512e548573e8bc3f9b999c78362c4e4c5bcec4
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Mon Apr 7 12:45:23 2025 -0700
Fix ST_AddPoint with empty point argument
References #5876
diff --git a/NEWS b/NEWS
index c7e6542cc..a4833b070 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ xxxx-xx-xx
PostgreSQL 11-17 required. GEOS 3.6+ required but GEOS 3.11+ to take advantage of all features.
Proj 4.9+ required.
+* Bug Fixes and Enhancements *
+
+ - #5876, Fix ST_AddPoint with empty point argument (Paul Ramsey)
+
+
PostGIS 3.3.8
2024-12-22
diff --git a/liblwgeom/lwgeom_api.c b/liblwgeom/lwgeom_api.c
index 43e5d374b..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 )
{
- LWDEBUGF(2, "%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 c512315b9..abe8704d2 100644
--- a/postgis/lwgeom_functions_basic.c
+++ b/postgis/lwgeom_functions_basic.c
@@ -2327,6 +2327,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 | 5 +++++
liblwgeom/lwgeom_api.c | 5 +++--
postgis/lwgeom_functions_basic.c | 5 +++++
3 files changed, 13 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list