[SCM] PostGIS branch stable-3.5 updated. 3.5.0-3-g1d23ccfb5

git at osgeo.org git at osgeo.org
Sun Sep 29 11:40:55 PDT 2024


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.5 has been updated
       via  1d23ccfb5ca405cbef828bcbfea5b599d2bef8f3 (commit)
      from  f4a3c03ce0f81db8d5fdc73032233e1af2584811 (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 1d23ccfb5ca405cbef828bcbfea5b599d2bef8f3
Author: Regina Obe <lr at pcorp.us>
Date:   Sun Sep 29 14:39:47 2024 -0400

    FIX for segfault in ST_MapAlgebra
    References #5785 for PostGIS 3.5.1
    Author: Dian M Fay

diff --git a/NEWS b/NEWS
index aac1e2297..db704583f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+PostGIS 3.5.1
+xxxx/xx/xx
+
+To take advantage of all postgis_sfcgal extension features SFCGAL 1.5+ is needed.
+PostgreSQL 12-17 required. GEOS 3.8+ required. Proj 6.1+ required. 
+
+* Bug fixes *
+
+- #5785, [raster] ST_MapAlgebra segfaults when expression references
+         a supernumerary rast argument (Dian M Fay)
+
 PostGIS 3.5.0
 2024/09/25
 
diff --git a/doc/introduction.xml b/doc/introduction.xml
index caa1b1e76..ab0e295bd 100644
--- a/doc/introduction.xml
+++ b/doc/introduction.xml
@@ -252,6 +252,7 @@
 					<member>David Garnier</member>
 					<member>David Skea</member>
 					<member>David Techer</member>
+					<member>Dian M Fay</member>
 					<member>Dmitry Vasilyev</member>
 					<member>Eduin Carrillo</member>
 					<member>Esteban Zimanyi</member>
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index d821a2fa6..d898c63af 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -1179,6 +1179,11 @@ static int rtpg_nmapalgebraexpr_callback(
 				if (idx < 1) continue;
 				idx--; /* 1-based now 0-based */
 
+				if (arg->rasters == 1 && i > 7) {
+					elog(ERROR, "rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster invocation");
+					return 0;
+				}
+
 				switch (i) {
 					/* [rast.x] */
 					case 0:
diff --git a/raster/test/regress/rt_mapalgebra_expr.sql b/raster/test/regress/rt_mapalgebra_expr.sql
index 240deb85c..78f90bb21 100644
--- a/raster/test/regress/rt_mapalgebra_expr.sql
+++ b/raster/test/regress/rt_mapalgebra_expr.sql
@@ -128,6 +128,11 @@ SELECT ST_Value(rast, 1, 1),
     ST_Value(ST_MapAlgebra(rast, 1, NULL, '[rast]/0'), 1, 1)
 FROM ST_TestRaster(0, 0, 10) rast;
 
+-- Test being cheeky with rast2 in a single-rast invocation
+SELECT ST_Value(rast, 1, 1),
+    ST_Value(ST_MapAlgebra(rast, 1, NULL, '[rast2.val]+1'), 1, 1)
+FROM ST_TestRaster(0, 0, 10) rast;
+
 -- Test evaluations to null (see #1523)
 WITH op AS ( select rast AS rin,
   ST_MapAlgebra(rast, 1, NULL, 'SELECT g from (SELECT NULL::double precision as g) as foo', 2)
diff --git a/raster/test/regress/rt_mapalgebra_expr_expected b/raster/test/regress/rt_mapalgebra_expr_expected
index ac33621e0..dccd7fc46 100644
--- a/raster/test/regress/rt_mapalgebra_expr_expected
+++ b/raster/test/regress/rt_mapalgebra_expr_expected
@@ -18,6 +18,7 @@ T10.8.2|10|50
 T10.8.3|10|37
 T10.8.4|10|30
 ERROR:  division by zero
+ERROR:  rtpg_nmapalgebraexpr_callback: rast2 argument specified in single-raster invocation
 T11.1|10|2
 T11.2|10|2
 T12|t|t|t|t

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

Summary of changes:
 NEWS                                            | 11 +++++++++++
 doc/introduction.xml                            |  1 +
 raster/rt_pg/rtpg_mapalgebra.c                  |  5 +++++
 raster/test/regress/rt_mapalgebra_expr.sql      |  5 +++++
 raster/test/regress/rt_mapalgebra_expr_expected |  1 +
 5 files changed, 23 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list