[SCM] PostGIS branch master updated. 3.7.0beta1-71-ge1f090fe8a
git at osgeo.org
git at osgeo.org
Mon Jul 27 11:12:11 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, master has been updated
via e1f090fe8a9c2ced44f22ca298668f255083f42b (commit)
via b0423f3c32725dcab5b61ae8f9f70688a9fdc2af (commit)
from 031ce41879e6635874edcfdcc925da55ae5c76fc (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 e1f090fe8a9c2ced44f22ca298668f255083f42b
Merge: 031ce41879 b0423f3c32
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date: Mon Jul 27 11:12:10 2026 -0700
Merge pull request 'Fix raster invalid reads found by Memcheck' (!523) from Komzpa/postgis:codex/raster-valgrind-invalid-reads-20260726 into master
Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/523
commit b0423f3c32725dcab5b61ae8f9f70688a9fdc2af
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Sun Jul 26 16:14:42 2026 +0300
Fix raster invalid reads found by Valgrind
diff --git a/NEWS b/NEWS
index 6d3526076a..9ce4ea3764 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ These are only changes since 3.7.0beta1.
- GT-545, Fix FlatGeobuf geometry, property, and spatial-index byte order on
big-endian platforms (Darafei Praliaskouski)
+ - [raster] Fix invalid reads in raster band initialization and
+ geotransform property access (Darafei Praliaskouski)
- GT-504, Report extension script/library version mismatches before loading
functions unavailable in an older library (Darafei Praliaskouski)
- GT-515, Reject invalid ST_LargestEmptyCircle boundaries before GEOS can
diff --git a/raster/rt_core/rt_band.c b/raster/rt_core/rt_band.c
index 5d71177443..c9738782be 100644
--- a/raster/rt_core/rt_band.c
+++ b/raster/rt_core/rt_band.c
@@ -142,6 +142,8 @@ rt_band_init_value(
memset(mem, 0, memsize);
return;
}
+ if (numval == 0)
+ return;
switch (pixtype) {
case PT_1BB:
diff --git a/raster/rt_pg/rtpg_raster_properties.c b/raster/rt_pg/rtpg_raster_properties.c
index 032e4975e9..c2717585e0 100644
--- a/raster/rt_pg/rtpg_raster_properties.c
+++ b/raster/rt_pg/rtpg_raster_properties.c
@@ -445,10 +445,8 @@ Datum RASTER_getGeotransform(PG_FUNCTION_ARGS)
double jmag;
double theta_i;
double theta_ij;
- /*
double xoffset;
double yoffset;
- */
TupleDesc result_tuple; /* for returning a composite */
Datum values[VALUES_LENGTH];
@@ -478,6 +476,8 @@ Datum RASTER_getGeotransform(PG_FUNCTION_ARGS)
rt_raster_get_y_skew(raster),
rt_raster_get_y_scale(raster),
&imag, &jmag, &theta_i, &theta_ij) ;
+ xoffset = rt_raster_get_x_offset(raster);
+ yoffset = rt_raster_get_y_offset(raster);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
@@ -501,8 +501,8 @@ Datum RASTER_getGeotransform(PG_FUNCTION_ARGS)
values[1] = Float8GetDatum(jmag);
values[2] = Float8GetDatum(theta_i);
values[3] = Float8GetDatum(theta_ij);
- values[4] = Float8GetDatum(rt_raster_get_x_offset(raster));
- values[5] = Float8GetDatum(rt_raster_get_y_offset(raster));
+ values[4] = Float8GetDatum(xoffset);
+ values[5] = Float8GetDatum(yoffset);
memset(nulls, FALSE, sizeof(bool) * VALUES_LENGTH);
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 ++
raster/rt_core/rt_band.c | 2 ++
raster/rt_pg/rtpg_raster_properties.c | 8 ++++----
3 files changed, 8 insertions(+), 4 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list