[SCM] PostGIS branch master updated. 3.6.0rc2-537-gadef2f6bd
git at osgeo.org
git at osgeo.org
Tue Jun 16 12:00:01 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 adef2f6bde7696bdb7f02198e02c02916b3a6da7 (commit)
via 974f241e4eec1c37f23ac9a8eae4a915f36d0b66 (commit)
from c8ea8a68f1b56b142988a8d1e61656a73f5084f5 (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 adef2f6bde7696bdb7f02198e02c02916b3a6da7
Merge: c8ea8a68f 974f241e4
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Tue Jun 16 22:57:58 2026 +0400
Merge pull request #879 from ProjectMutilation/fix-string-allocation-size
raster: Fix memory overallocation
commit 974f241e4eec1c37f23ac9a8eae4a915f36d0b66
Author: Maksim Korotkov <m.korotkov at postgrespro.ru>
Date: Mon Jun 15 18:16:13 2026 +0300
raster: Fix memory overallocation
Replace sizeof(char *) with strlen()+1 for string allocation,
eliminating 8x memory overallocation on 64-bit platforms.
Found by PostgresPro
Signed-off-by: Maksim Korotkov <m.korotkov at postgrespro.ru>
diff --git a/raster/rt_pg/rtpg_geometry.c b/raster/rt_pg/rtpg_geometry.c
index 5bfd62ad9..6a006f5f2 100644
--- a/raster/rt_pg/rtpg_geometry.c
+++ b/raster/rt_pg/rtpg_geometry.c
@@ -1534,7 +1534,7 @@ Datum RASTER_asRaster(PG_FUNCTION_ARGS)
options = (char **) repalloc(options, sizeof(char *) * options_len);
}
- options[options_len - 1] = palloc(sizeof(char*) * (strlen("ALL_TOUCHED=TRUE") + 1));
+ options[options_len - 1] = palloc(sizeof(char) * (strlen("ALL_TOUCHED=TRUE") + 1));
strcpy(options[options_len - 1], "ALL_TOUCHED=TRUE");
}
diff --git a/raster/rt_pg/rtpg_mapalgebra.c b/raster/rt_pg/rtpg_mapalgebra.c
index 57ce89a52..865fb3a55 100644
--- a/raster/rt_pg/rtpg_mapalgebra.c
+++ b/raster/rt_pg/rtpg_mapalgebra.c
@@ -3300,7 +3300,7 @@ Datum RASTER_clip(PG_FUNCTION_ARGS)
if (!PG_ARGISNULL(5) && PG_GETARG_BOOL(5) == TRUE){
options_len = options_len + 1;
options = (char **) palloc(sizeof(char *) * options_len);
- options[options_len - 1] = palloc(sizeof(char*) * (strlen("ALL_TOUCHED=TRUE") + 1));
+ options[options_len - 1] = palloc(sizeof(char) * (strlen("ALL_TOUCHED=TRUE") + 1));
strcpy(options[options_len - 1], "ALL_TOUCHED=TRUE");
}
-----------------------------------------------------------------------
Summary of changes:
raster/rt_pg/rtpg_geometry.c | 2 +-
raster/rt_pg/rtpg_mapalgebra.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list