[postgis-tickets] [SCM] PostGIS branch stable-2.4 updated. 2cec61e64a94dab4560149b68fc9948ad91d5ed5

git at osgeo.org git at osgeo.org
Tue Jun 9 09:41:58 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.4 has been updated
       via  2cec61e64a94dab4560149b68fc9948ad91d5ed5 (commit)
      from  7ee17e04c36e50dfe584a4ed574b28049b667d06 (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 2cec61e64a94dab4560149b68fc9948ad91d5ed5
Author: Regina Obe <lr at pcorp.us>
Date:   Tue Jun 9 12:41:47 2020 -0400

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

diff --git a/NEWS b/NEWS
index 2d6f133..1fd002b 100644
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,7 @@ PostGIS 2.4.9
   - #4646, Fix gserialized_cmp incorrect comparison (dkvash)
   - #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)
+  - #4699, crash on null input to ST_Union(raster, otherarg) (Jaime Casanova, 2ndQuadrant)
 
 
 PostGIS 2.4.8
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index 729215c..afbf309 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -2887,8 +2887,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