[postgis-tickets] [SCM] PostGIS branch stable-2.5 updated. 2.5.4-12-gce30368

git at osgeo.org git at osgeo.org
Tue Jun 9 09:31:43 PDT 2020


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-2.5 has been updated
       via  ce3036809b72fdf75c8556a0a78f4b9b84571c54 (commit)
      from  876445a448345b03f4706862d0942a6689d0e4b4 (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 ce3036809b72fdf75c8556a0a78f4b9b84571c54
Author: Regina Obe <lr at pcorp.us>
Date:   Tue Jun 9 12:31:33 2020 -0400

    Fix for raster crash. References #4699 for 2.5.5 - Jaime Casanova (2nd Quadrant)

diff --git a/NEWS b/NEWS
index f35ade2..c163159 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PostGIS 2.5.5
   - #4652, Fix several memory related bugs in ST_GeomFromGML (Raúl Marín)
   - #4661, Fix access to spatial_ref_sys with a non default schema (Raúl Marín)
   - #4670, ST_AddPoint: Fix bug when a positive position is requested (Raúl Marín)
+  - #4699, crash on null input to ST_Union(raster, otherarg) (Jaime Casanova, 2ndQuadrant)
 
 PostGIS 2.5.4
 2020/02/28
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index 4f20a81..0542228 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -2896,8 +2896,11 @@ Datum RASTER_union_finalfn(PG_FUNCTION_ARGS)
 				PG_RETURN_NULL();
 			}
 		}
-		else
+		else {
 			_raster = iwr->bandarg[i].raster[0];
+			if (_raster == NULL)
+				continue;
+		}
 
 		/* first band, _rtn doesn't exist */
 		if (i < 1) {
diff --git a/raster/test/regress/rt_union.sql b/raster/test/regress/rt_union.sql
index a64b23a..fb93ae0 100644
--- a/raster/test/regress/rt_union.sql
+++ b/raster/test/regress/rt_union.sql
@@ -457,3 +457,5 @@ DROP TABLE IF EXISTS raster_union_out;
 -- Some toxic input
 SELECT 'none', ST_Union(r) from ( select null::raster r where false ) f;
 SELECT 'null', ST_Union(null::raster);
+--#4699 crash
+SELECT 'null-1', ST_Union(null::raster,1);
diff --git a/raster/test/regress/rt_union_expected b/raster/test/regress/rt_union_expected
index 51cc3e3..699b9df 100644
--- a/raster/test/regress/rt_union_expected
+++ b/raster/test/regress/rt_union_expected
@@ -627,3 +627,4 @@ LAST|2|9|4
 LAST|3|9|4
 none|
 null|
+null-1|

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

Summary of changes:
 NEWS                                  | 1 +
 raster/rt_pg/rtpg_mapalgebra.c        | 5 ++++-
 raster/test/regress/rt_union.sql      | 2 ++
 raster/test/regress/rt_union_expected | 1 +
 4 files changed, 8 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list