[postgis-tickets] [SCM] PostGIS branch stable-3.1 updated. 3.1.8-5-g5b6b96456
git at osgeo.org
git at osgeo.org
Sat Feb 18 02:18:40 PST 2023
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.1 has been updated
via 5b6b96456f3c4259d303437f2a55b87bbbd0b444 (commit)
from 11335bb4b9ab654e4d0a525800dd28e7484018e3 (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 5b6b96456f3c4259d303437f2a55b87bbbd0b444
Author: Regina Obe <lr at pcorp.us>
Date: Sat Feb 18 03:18:24 2023 -0500
ST_AsLatLon infinite coordinate.
References #5342 for PostGIS 3.1.9
diff --git a/NEWS b/NEWS
index 1588cbafc..66f5952f1 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ xxxx/xx/xx
* Bug Fixes
- #5338, Dump/Restore of raster table fails on
enforce_coverage_tile_rast constraint (Regina Obe)
- - #5315, #5318, #5319, #5320 crashes on infinite coordinates
+ - #5315, #5318, #5319, #5320, #5342 crashes on infinite coordinates
(Regina Obe, Paul Ramsey)
PostGIS 3.1.8
diff --git a/postgis/lwgeom_inout.c b/postgis/lwgeom_inout.c
index d5b076846..55f335893 100644
--- a/postgis/lwgeom_inout.c
+++ b/postgis/lwgeom_inout.c
@@ -236,6 +236,11 @@ Datum LWGEOM_to_latlon(PG_FUNCTION_ARGS)
PG_RETURN_NULL();
}
+ if (!lwgeom_isfinite(lwgeom)) {
+ lwpgerror("ST_AsLatLonText: invalid coordinate");
+ PG_RETURN_NULL();
+ }
+
format_str = text_to_cstring(format_text);
assert(format_str != NULL);
diff --git a/regress/core/out_geometry.sql b/regress/core/out_geometry.sql
index b8f41b913..e3c6ecc01 100644
--- a/regress/core/out_geometry.sql
+++ b/regress/core/out_geometry.sql
@@ -172,4 +172,7 @@ SELECT 'text_precision_02', ST_AsText(GeomFromEWKT('SRID=4326;POINT(111.1111111
--
SELECT 'EWKT_' || i, ST_AsEWKT('SRID=4326;POINT(12345678.123456789 1)'::geometry, i)
FROM generate_series(0, 20) AS t(i)
-ORDER BY i;
\ No newline at end of file
+ORDER BY i;
+
+-- infinite latlon https://trac.osgeo.org/postgis/ticket/5342
+SELECT '#5342' As ticket, ST_AsLatLonText('0101000020E6100000000000000000F07F000000000000F07F'::geometry);
diff --git a/regress/core/out_geometry_expected b/regress/core/out_geometry_expected
index 13f0c88bd..029439849 100644
--- a/regress/core/out_geometry_expected
+++ b/regress/core/out_geometry_expected
@@ -111,3 +111,4 @@ EWKT_17|SRID=4326;POINT(12345678.12345679 1)
EWKT_18|SRID=4326;POINT(12345678.12345679 1)
EWKT_19|SRID=4326;POINT(12345678.12345679 1)
EWKT_20|SRID=4326;POINT(12345678.12345679 1)
+ERROR: ST_AsLatLonText: invalid coordinate
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 +-
postgis/lwgeom_inout.c | 5 +++++
regress/core/out_geometry.sql | 5 ++++-
regress/core/out_geometry_expected | 1 +
4 files changed, 11 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list