[SCM] PostGIS branch master updated. 3.7.0rc1-119-gdcc888996
git at osgeo.org
git at osgeo.org
Mon Oct 19 21:07:40 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 dcc88899636fbd8ad28c85e229bb2637c7f583a2 (commit)
via 6a9387914570bcdcf6a4a4b4557a17a9c6abeb28 (commit)
from 29d3ddac6f653edb4e74374607b2547e14ffcee5 (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 dcc88899636fbd8ad28c85e229bb2637c7f583a2
Author: Regina Obe <lr at pcorp.us>
Date: Tue Oct 20 00:07:30 2026 -0400
Prep for 3.7.0 release
diff --git a/NEWS b/NEWS
index 1751d30cc..97e97f46b 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,5 @@
PostGIS 3.7.0rc3
-2026/10/xx
+2026/10/19
This version requires GEOS 3.10+, PostgreSQL 14-19beta3, Proj 6.1+, and libgmp.
To take advantage of all postgis extension features, GEOS 3.15+ is needed.
diff --git a/Version.config b/Version.config
index 2e5a68cb5..de68a1315 100644
--- a/Version.config
+++ b/Version.config
@@ -5,7 +5,7 @@
POSTGIS_MAJOR_VERSION=3
POSTGIS_MINOR_VERSION=7
-POSTGIS_MICRO_VERSION=0dev
+POSTGIS_MICRO_VERSION=0rc3
# Liblwgeom interface versioning, reset to 0:0:0 (cur:age:rev)
# when changing POSTGIS_MINOR_VERSION
commit 6a9387914570bcdcf6a4a4b4557a17a9c6abeb28
Author: Maksim Korotkov <m.korotkov at postgrespro.ru>
Date: Mon Sep 7 18:06:41 2026 +0300
loader: check column map allocations and fix cleanup
Check the return of malloc/calloc in colmap_read and bail out with an
error instead of dereferencing NULL on the pgfieldnames/dbffieldnames
array and per-field string allocations. The column map arrays are now
calloc'd so unused slots are NULL-initialized.
Rework colmap_clean to be safe on partial state: early-return on NULL,
free the field-name arrays unconditionally (free(NULL) is valid), and
reset the map via colmap_init so the map is reusable and a subsequent
ShpLoaderDestroy colmap_clean call stays safe. The calloc-failure path
resets map->size first so the cleanup loop doesn't index a half-allocated
array.
Signed-off-by: Maksim Korotkov <m.korotkov at postgrespro.ru>
Closes https://github.com/postgis/postgis/pull/1178 for 3.7.0
diff --git a/loader/shpcommon.c b/loader/shpcommon.c
index d8d0fd9d5..fd9433bbe 100644
--- a/loader/shpcommon.c
+++ b/loader/shpcommon.c
@@ -176,18 +176,21 @@ void
colmap_clean(colmap *map)
{
int i;
- if (map != NULL){
- if (map->size)
+ if (map == NULL)
+ {
+ return;
+ }
+ if (map->size)
+ {
+ for (i = 0; i < map->size; i++)
{
- for (i = 0; i < map->size; i++)
- {
- if (map->pgfieldnames[i]) free(map->pgfieldnames[i]);
- if (map->dbffieldnames[i]) free(map->dbffieldnames[i]);
- }
- free(map->pgfieldnames);
- free(map->dbffieldnames);
+ free(map->pgfieldnames[i]);
+ free(map->dbffieldnames[i]);
}
}
+ free(map->pgfieldnames);
+ free(map->dbffieldnames);
+ colmap_init(map);
}
const char *
@@ -237,13 +240,30 @@ colmap_read(const char *filename, colmap *map, char *errbuf, size_t errbuflen)
return 0;
}
+ /* Release any prior contents and reset the map so this call is safe to
+ * reuse on the same struct (and so ++map->size below starts from zero) */
+ colmap_clean(map);
+
/* First count how many columns we have... */
while (fgets(linebuffer, 1024, fptr) != NULL) ++map->size;
+ if (!map->size)
+ {
+ fclose(fptr);
+ return 1;
+ }
/* Now we know the final size, allocate the arrays and load the data */
fseek(fptr, 0, SEEK_SET);
- map->pgfieldnames = (char **)malloc(sizeof(char *) * map->size);
- map->dbffieldnames = (char **)malloc(sizeof(char *) * map->size);
+ map->pgfieldnames = (char **)calloc(map->size, sizeof(char *));
+ map->dbffieldnames = (char **)calloc(map->size, sizeof(char *));
+ if (!map->pgfieldnames || !map->dbffieldnames)
+ {
+ map->size = 0;
+ colmap_clean(map);
+ fclose(fptr);
+ snprintf(errbuf, errbuflen, _("ERROR: Unable to allocate memory for column map file %s"), filename);
+ return 0;
+ }
/* Read in a line at a time... */
curmapsize = 0;
@@ -256,6 +276,13 @@ colmap_read(const char *filename, colmap *map, char *errbuf, size_t errbuflen)
/* Allocate memory and copy the string ensuring it is terminated */
map->pgfieldnames[curmapsize] = malloc(fieldnamesize + 1);
+ if (!map->pgfieldnames[curmapsize])
+ {
+ colmap_clean(map);
+ fclose(fptr);
+ snprintf(errbuf, errbuflen, _("ERROR: Unable to allocate memory for column map file %s"), filename);
+ return 0;
+ }
strncpy(map->pgfieldnames[curmapsize], tmpstr, fieldnamesize);
map->pgfieldnames[curmapsize][fieldnamesize] = '\0';
@@ -268,6 +295,13 @@ colmap_read(const char *filename, colmap *map, char *errbuf, size_t errbuflen)
/* Allocate memory and copy the string ensuring it is terminated */
map->dbffieldnames[curmapsize] = malloc(fieldnamesize + 1);
+ if (!map->dbffieldnames[curmapsize])
+ {
+ colmap_clean(map);
+ fclose(fptr);
+ snprintf(errbuf, errbuflen, _("ERROR: Unable to allocate memory for column map file %s"), filename);
+ return 0;
+ }
strncpy(map->dbffieldnames[curmapsize], tmpstr, fieldnamesize);
map->dbffieldnames[curmapsize][fieldnamesize] = '\0';
-----------------------------------------------------------------------
Summary of changes:
NEWS | 2 +-
Version.config | 2 +-
loader/shpcommon.c | 56 +++++++++++++++++++++++++++++++++++++++++++-----------
3 files changed, 47 insertions(+), 13 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list