[SCM] PostGIS branch stable-3.6 updated. 3.6.4-153-g82b51ba31

git at osgeo.org git at osgeo.org
Thu Oct 8 22:45:36 PDT 2026


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.6 has been updated
       via  82b51ba31c5303c600d9bb6272ed4e94c6843115 (commit)
       via  74aaee38cdfc30ba4faca709060195a940d2e0fd (commit)
      from  5b7cc4e0c21da58a219d6e1d72ec2332054250b8 (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 82b51ba31c5303c600d9bb6272ed4e94c6843115
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Oct 9 01:45:09 2026 -0400

    Add NEWS for https://github.com/postgis/postgis/pull/1179

diff --git a/NEWS b/NEWS
index 27738d128..6f085e24b 100644
--- a/NEWS
+++ b/NEWS
@@ -85,6 +85,8 @@ PostGIS 3.6.5dev
 - #6109, Out-of-bounds heap read in BOX2D_out and BOX2D_expand
   on 65-byte box2d under ASAN (Dennis Tighe, Google)
 - #6127, ToastCacheGetGeometry error on PG20 (Laurenz Albe)
+- GH-1179, [raster] check array_range allocation and
+  free on the error branch (Maksim Korotkov, PostgresPro)
 - GH-1180, [raster] make rtstrdup return NULL
   on allocation failure (Maksim Korotkov, PostgresPro)
 

commit 74aaee38cdfc30ba4faca709060195a940d2e0fd
Author: Maksim Korotkov <m.korotkov at postgrespro.ru>
Date:   Tue Sep 8 16:10:36 2026 +0300

    raster: check array_range allocation and free on the error branch
    
    rtalloc in array_range could return NULL and be dereferenced when
    filling the range array; check the result and return the existing
    error code (0) instead. Also rtdealloc the already-allocated range in
    the (currently unreachable) else branch before nulling the pointer, so
    no allocation leaks on the error path.
    
    Signed-off-by: Maksim Korotkov <m.korotkov at postgrespro.ru>
    
    Closes https://github.com/postgis/postgis/pull/1179
    for PostGIS 3.6.5

diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c
index f593ac64b..917d0aaa5 100644
--- a/raster/loader/raster2pgsql.c
+++ b/raster/loader/raster2pgsql.c
@@ -110,6 +110,12 @@ array_range(int min, int max, int step, int **range, uint32_t *len) {
 	*len = (uint32_t) ((abs(max - min) + 1 + (step / 2)) / step);
 	*range = rtalloc(sizeof(int) * *len);
 
+	if (!*range)
+	{
+		*len = 0;
+		return 0;
+	}
+
 	if (min < max) {
 		for (i = min, j = 0; i <= max; i += step, j++)
 			(*range)[j] = i;
@@ -124,6 +130,7 @@ array_range(int min, int max, int step, int **range, uint32_t *len) {
 	}
 	else {
 		*len = 0;
+		rtdealloc(*range);
 		*range = NULL;
 		return 0;
 	}

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

Summary of changes:
 NEWS                         | 2 ++
 raster/loader/raster2pgsql.c | 7 +++++++
 2 files changed, 9 insertions(+)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list