[postgis-tickets] [SCM] PostGIS branch stable-3.0 updated. 3.0.8-5-g8b6d76afb

git at osgeo.org git at osgeo.org
Sat Feb 18 02:24:27 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.0 has been updated
       via  8b6d76afb78f5b74d870435a670018e65ef0fea9 (commit)
      from  92e7399245050479ce0c464279d6f6aac80d551e (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 8b6d76afb78f5b74d870435a670018e65ef0fea9
Author: Regina Obe <lr at pcorp.us>
Date:   Sat Feb 18 05:23:00 2023 -0500

    ST_AsLatLon infinite coordinate.
    Closes #5342 for PostGIS 3.0.9

diff --git a/NEWS b/NEWS
index e22648026..74677ee5d 100644
--- a/NEWS
+++ b/NEWS
@@ -4,8 +4,8 @@ xxxx/xx/xx
 * Bug Fixes *
   - #5338, Dump/Restore of raster table fails on
   		     enforce_coverage_tile_rast constraint (Regina Obe)
-  - #5315, #5319, #5320 crashes on infinite coordinates
-          (Regina Obe, Paul Ramsey)
+  - #5315, #5319, #5320, #5342 crashes on infinite coordinates
+          (Regina Obe, Paul Ramsey):
 
 PostGIS 3.0.8
 2022/11/11
diff --git a/postgis/lwgeom_inout.c b/postgis/lwgeom_inout.c
index 8fa7ce89b..c3470699d 100644
--- a/postgis/lwgeom_inout.c
+++ b/postgis/lwgeom_inout.c
@@ -222,6 +222,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 fdc9a5cd6..289c314b4 100644
--- a/regress/core/out_geometry.sql
+++ b/regress/core/out_geometry.sql
@@ -166,3 +166,6 @@ SELECT 'pgcast_06',ST_AsText('((0,0),(0,1),(1,1),(1,0))'::polygon::geometry);
 -- Precision
 SELECT 'text_precision_01', ST_AsText(GeomFromEWKT('SRID=4326;POINT(111.1111111 1.1111111)'));
 SELECT 'text_precision_02', ST_AsText(GeomFromEWKT('SRID=4326;POINT(111.1111111 1.1111111)'),2);
+
+-- 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 470720693..27227d109 100644
--- a/regress/core/out_geometry_expected
+++ b/regress/core/out_geometry_expected
@@ -90,3 +90,4 @@ pgcast_05|t
 pgcast_06|POLYGON((0 0,0 1,1 1,1 0,0 0))
 text_precision_01|POINT(111.1111111 1.1111111)
 text_precision_02|POINT(111.11 1.11)
+ERROR:  ST_AsLatLonText: invalid coordinate

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

Summary of changes:
 NEWS                               | 4 ++--
 postgis/lwgeom_inout.c             | 5 +++++
 regress/core/out_geometry.sql      | 3 +++
 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