[SCM] PostGIS branch master updated. 3.7.0rc1-29-gc0793ca1e
git at osgeo.org
git at osgeo.org
Mon Sep 7 05:23:24 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 c0793ca1e25eba653a5cc500f600daa9fd936f68 (commit)
via 95abfeebc9c30f325bb6ad8b07e13eb774696ce2 (commit)
via 269bafce80a93c5b38ab2b05975056dcc1c5c1a1 (commit)
via 828d586e6cb8c3941b3b6f7c1df1c6d94db546ed (commit)
from a63ceaff1b4f012d33e66f082b202b6c93c326d5 (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 c0793ca1e25eba653a5cc500f600daa9fd936f68
Merge: a63ceaff1 95abfeebc
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date: Mon Sep 7 05:23:22 2026 -0700
Merge pull request 'Reject empty geometry type modifiers' (!769) from Komzpa/postgis:codex/postgis-1176-20260907 into master
Reject empty geometry type modifiers before computing the
trailing-space index in geometry_type_from_string(). This prevents an
out-of-bounds read caused by strlen(str) - 1 underflow.
Add regression coverage for empty input and preserve initialized
output values on failure.
Patch by Egor Ivkov, with SQL regression coverage and contributor
metadata updates by Darafei Praliaskouski.
Closes #6118
Closes https://github.com/postgis/postgis/pull/1176
Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/769
commit 95abfeebc9c30f325bb6ad8b07e13eb774696ce2
Merge: 269bafce8 a63ceaff1
Author: Darafei Praliaskouski <me at komzpa.net>
Date: Mon Sep 7 15:12:52 2026 +0400
Preserve empty typmod outputs and add SQL regression coverage
Keep the two original contributor commits unchanged and integrate current master. Initialize output fields before rejecting an empty modifier, assert the failure contract, and add SQL regression coverage, release notes and author alias normalization.
References #6118
diff --cc .mailmap
index 7fe3926ab,7fe3926ab..359927848
--- a/.mailmap
+++ b/.mailmap
@@@ -40,6 -40,6 +40,8 @@@ Mehmet Ince <mehmet at mehmetince.net> Meh
Edouard Choinière <echoix at users.noreply.weblate.osgeo.org> Edouard Choiniere <echoix at users.noreply.weblate.osgeo.org>
++Egor Ivkov <e.ivkov at arenadata.io> <e.o.ivkov at gmail.com>
++
Esteban Zimányi <estebanzimanyi at gmail.com> Esteban ZIMANYI <ezimanyi at xinu8.ulb.ac.be>
Esteban Zimányi <estebanzimanyi at gmail.com> Esteban Zimanyi <esteban.zimanyi at ulb.be>
Esteban Zimányi <estebanzimanyi at gmail.com> Esteban Zimanyi <estebanzimanyi at gmail.com>
diff --cc NEWS
index 8fa9ba9cb,fa9879877..e9da6cc3c
--- a/NEWS
+++ b/NEWS
@@@ -1,3 -1,174 +1,176 @@@
+ PostGIS 3.7.0rc2
+ 2026/xx/xx
+
+ This version requires GEOS 3.10+, PostgreSQL 14-19beta1, Proj 6.1+, and libgmp.
+ To take advantage of all postgis extension features, GEOS 3.15+ is needed.
+ To take advantage of all postgis_sfcgal extension features SFCGAL 2.3+ is needed.
+
+ * Breaking Changes *
+
+ - #5688, [topology] topology building functions now interpret tolerance 0
+ (old default) to really mean 0 and want -1 (new default) to mean
+ "use topology precision" (Sandro Santilli)
+ - #6024, Remove support for PostgreSQL 12 and 13 (Regina Obe)
+ - #6040, ST_GeoHash round trip through ST_GeomFromGeoHash (Paul Ramsey)
+ - #6053, [address_standardizer] Extension removed and moved to
+ https://github.com/postgis/address_standardizer (Paul Ramsey)
+ - #6052, [tiger_geocoder] Extension removed and moved to
+ https://git.osgeo.org/postgis/postgis_tiger_geocoder (Regina Obe)
+ - #6079, Remove support for GEOS < 3.10 (Sandro Santilli)
+ - #1793, Remove ST_MemCollect aggregate (Darafei Praliaskouski)
+ - GH-848, CG_AlphaShape now returns a MultiPolygon (Jean Felder)
+ - [docs] Python 3 and an SVG rasterizer (rsvg-convert preferred,
+ GraphicsMagick or ImageMagick supported) now required for doc
+ building (Darafei Praliaskouski)
+
+ * New Features *
+
+ - #1124, #2935, #3033, #4658, #4659, [loader] Rework loader arguments:
+ shp2pgsql can create UNLOGGED tables and choose the feature id column
+ name, shp2pgsql --drop-table can emit DROP TABLE before prepare
+ output, raster2pgsql/shp2pgsql expose loader actions as long options,
+ both loaders accept long aliases for existing options, and
+ --if-not-exists makes creation actions idempotent
+ (Darafei Praliaskouski)
+ - #4208, Add single-geometry variants of ST_MaxDistance and ST_LongestLine
+ (Darafei Praliaskouski)
+ - [topology] FindVertexSegmentPairsBelowDistance function (Sandro Santilli)
+ - ST_CoverageEdges, returns MultiLinestring of distinct shared edges in
+ polygonal coverage (Paul Ramsey)
+ - ST_MinimumSpanningTree, window function to calculate MST (Paul Ramsey)
+ - #5993, [topology] Add max_edges parameter to TopoGeo_AddLinestring
+ (Sandro Santilli)
+ - #6001, support MultiLineString in ST_MakeLine (Paul Ramsey)
+ - #2858, ST_MMin and ST_MMax (Paul Ramsey)
+ - #5941, [raster] Support GDT_Float16 pixel type (Darafei Praliaskouski)
+ - #5992, Optimize GiST index for repeated edge subdivision in topology (Darafei Praliaskouski)
+ - #5702, Allow the compiler to detect the parallelism -flto=auto (Darafei Praliaskouski)
+ - #4798, ST_AsGeoJSON warns about duplicate property keys (Darafei Praliaskouski)
+ - #4222, [raster] ST_DumpAsPolygons honours PostgreSQL interrupts (Darafei Praliaskouski)
+ - #5889, [topology] Include representative locations in topology build errors (Darafei Praliaskouski)
+ - #2614, Use GEOSPreparedDistance and caching to accelerate ST_DWithin (Paul Ramsey)
+ - GH-839, ST_Multi support for TIN and surfaces (Loïc Bartoletti)
+ - #4398, Add ST_CatmullSmoothing smoothes but retains original vertices (Paul Ramsey)
+ - #4560, ST_3DInterpolatePoint for M interpolation from XYZ inputs (Paul Ramsey)
+ - #1291, ST_MakePolygon support for curved rings (Darafei Praliaskouski)
+ - GT-270, Add NURBSCurve (Loïc Bartoletti)
+ - #2863, Add ST_XSize, ST_YSize, ST_ZSize, and ST_MSize dimension helpers
+ (Darafei Praliaskouski)
+
+ * Enhancements *
+
+ - #2045, pgsql2shp query dumps no longer require temporary table
+ privileges (Darafei Praliaskouski)
+ - #1577, [loader] Report unsupported .zip archive input before trying
+ to open shapefile sidecar files (Darafei Praliaskouski)
+ - #3158, Move geometry and geography typmod bit helpers out of the
+ public liblwgeom header (Darafei Praliaskouski)
+ - #3776, [raster] Keep distinct 32-bit integer pixel values separate in
+ ST_DumpAsPolygons (Darafei Praliaskouski)
+ - #4678, [raster] Move st_sum4ma neighborhood callback to C
+ (Darafei Praliaskouski)
+ - #2116, [raster] Add ST_Value nearest-neighbor boundary options
+ (Darafei Praliaskouski)
+ - #2804, #4315, [raster] Support two-argument ST_MapAlgebra callbacks
+ and pass callback call data as actual arguments (Darafei Praliaskouski)
+ - #6062, [topology] Stop using recursive snapping, for improved robustness (Sandro Santilli)
+ - #6065, Improved winding order computation robustness for rings having collapsed elements
+ (Sandro Santilli)
+ - #2137, [raster] Reuse matching source raster overviews in raster2pgsql -l
+ (Darafei Praliaskouski)
+ - #4749, Use point-in-polygon predicate fast paths for point-only
+ GeometryCollections (Darafei Praliaskouski)
+ - #2807, [raster] Preserve missing NODATA values in ST_MapAlgebra outputs
+ (Darafei Praliaskouski)
+ - #2832, [raster] Avoid padding single-tile raster2pgsql overviews
+ when padding is not requested (Darafei Praliaskouski)
+ - #2623, Generate a pgsql2shp GID field when exporting geometry-only
+ shapefiles (Darafei Praliaskouski)
+ - #2850, Preserve pgsql2shp numeric precision and scale in DBF metadata
+ (Darafei Praliaskouski)
+ - Build PostgreSQL extension modules with `-fno-semantic-interposition` when
+ available so LTO can optimize same-DSO calls to exported PostGIS
+ entry points directly instead of routing through the module PLT; in
+ a local PostgreSQL 18 `pgbench` microbenchmark over 100k four-point
+ groups this reduced `ST_Collect` aggregate latency by about 4%
+ (Darafei Praliaskouski)
+ - #5973, Install PostGIS utilities under `pg_config --bindir` by default
+ and document `pg_config`-derived install paths more accurately
+ (Darafei Praliaskouski)
+ - #2808, Clarify postgis_full_version() output when installed component
+ scripts are newer than core scripts (Darafei Praliaskouski)
+ - #2838, Emit valid X3D Coordinate nodes for 2D polygon output
+ (Darafei Praliaskouski)
+ - GH-899, [raster] Honor PostgreSQL interrupts in long-running GDAL
+ progress callbacks (Darafei Praliaskouski)
+ - #6073, #6074, Stabilize geography LRS endpoint interpolation and pole
+ centroid regressions on 32-bit systems (Darafei Praliaskouski)
+ - #2583, Preserve Z/ZM dimensional qualifiers in ST_AsEWKT output for TIN
+ (Darafei Praliaskouski)
+ - #4616, Detect pgsql2shp query keywords case-insensitively
+ (Darafei Praliaskouski)
+ - #1986, ST_GeomFromGML support for GML ArcString and curved polygon rings
+ (Darafei Praliaskouski)
+ - #4749, Use point-in-polygon predicate fast paths for point-only
+ GeometryCollections, including ST_Disjoint (Darafei Praliaskouski)
+ - #3676, Mark geometry and geography btree comparison support functions
+ as leakproof (Darafei Praliaskouski)
+ - GH-875, Allow ST_OrderingEquals joins to use hash and merge join plans
+ (Darafei Praliaskouski)
+ - #1168, [raster] Support curved geometry inputs in ST_AsRaster
+ (Darafei Praliaskouski)
+ - #1416, ST_AsX3D outputs NURBSCURVE as X3D NurbsCurve
+ and linearizes other curve geometries
+ (Darafei Praliaskouski)
+ - #3705, ST_AsX3D outputs valid coordinate nodes for 2D multi-geometries
+ and GeometryCollections (Darafei Praliaskouski)
+ - GT-484, Use column-level SELECT privileges for metadata views
+ (Arthur Bazin)
+ - #1408, #2386, #2557, #2805, #2898, #3743, #4323, #4332, #4385, #5109,
+ #5532, #5593, #5638, #5645, #5950, #6022, #6082, GH-1161, GT-584,
+ Numerous doc enhancements (Darafei Praliaskouski)
+
+ * Bug Fixes *
+
++ - #6118, Reject empty geometry type modifiers without an out-of-bounds read
++ (Egor Ivkov)
+ - Fix WKB and TWKB parser resource exhaustion on malformed input
+ (Darafei Praliaskouski)
+ - #6038, Avoid stale relation lookups in geometry_columns after topology
+ objects are dropped (Darafei Praliaskouski)
+ - #5487, Improve error detail for repeated upgrades after an incomplete
+ deprecated-function cleanup (Darafei Praliaskouski)
+ - #5975, Initialize skipped union-find cluster ids deterministically
+ (Darafei Praliaskouski)
+ - #5904, [topology] Avoid MinGW format warnings when logging topology ids
+ (Darafei Praliaskouski)
+ - GH-888, [sfcgal] Avoid stale detoasted geometry access in
+ CG_Visibility empty-input handling for SFCGAL < 2.2
+ (Darafei Praliaskouski)
+ - #3179, Mark truncated libpgcommon PostgreSQL messages instead of silently
+ dropping the tail (Darafei Praliaskouski)
+ - #6003, Avoid size_t formats in liblwgeom logging/error wrappers for
+ MinGW builds (Darafei Praliaskouski)
+ - GH-886, ST_ClusterRelateWin validates NULL relate matrices before
+ detoasting them (Darafei Praliaskouski)
+ - GH-889, ST_Relate pattern inversion avoids out-of-bounds access on
+ short DE-9IM patterns (Darafei Praliaskouski)
+ - GH-890, Avoid GIDX BRIN summary merges across mismatched dimensions
+ (Darafei Praliaskouski)
+ - #5959, Prevent histogram target overflow when analysing massive tables (Darafei Praliaskouski)
+ - #6080, Avoid out-of-bounds hex WKB lookup for high-bit input bytes
+ (Darafei Praliaskouski)
+ - #4828, geometry_columns handles NOT VALID SRID checks without errors (Darafei Praliaskouski)
+ - #6048, [raster] ST_Clip no longer crashes when clipping sparse band
+ selections (Darafei Praliaskouski)
+ - GH-894, [raster] Fix Float16 import, mixed nodata warping,
+ band replacement cleanup, GDAL credential redaction, and Python
+ GDAL compatibility (Darafei Praliaskouski)
+
+
+
+
+
PostGIS 3.7.0rc1
2026/08/24
This version requires GEOS 3.10+, PostgreSQL 14-19beta2, Proj 6.1+, libgmp.
diff --cc liblwgeom/cunit/cu_gserialized1.c
index 72840c670,c31228c75..73359d720
--- a/liblwgeom/cunit/cu_gserialized1.c
+++ b/liblwgeom/cunit/cu_gserialized1.c
@@@ -444,14 -444,6 +444,20 @@@ static void test_geometry_type_from_str
//printf("\n in type: %s\nout type: %d\n out z: %d\n out m: %d", str, type, z, m);
CU_ASSERT_EQUAL(rv, LW_FAILURE);
++ /* Empty and whitespace-only modifiers must fail without reading past input. */
++ type = 42;
++ z = 1;
++ m = 1;
+ str = "";
+ rv = geometry_type_from_string(str, &type, &z, &m);
+ CU_ASSERT_EQUAL(rv, LW_FAILURE);
++ CU_ASSERT_EQUAL(type, 0);
++ CU_ASSERT_EQUAL(z, 0);
++ CU_ASSERT_EQUAL(m, 0);
+
+ str = " ";
+ rv = geometry_type_from_string(str, &type, &z, &m);
+ CU_ASSERT_EQUAL(rv, LW_FAILURE);
-
}
static void test_lwgeom_count_vertices(void)
diff --cc liblwgeom/lwutil.c
index a175dc1ba,514976d1c..95cae7031
--- a/liblwgeom/lwutil.c
+++ b/liblwgeom/lwutil.c
@@@ -488,9 -482,9 +483,14 @@@ int geometry_type_from_string(const cha
*z = 0;
*m = 0;
++ str_len = strlen(str);
++ /* Empty string is not a valid type. */
++ if (str_len == 0)
++ return LW_FAILURE;
++
/* Locate any leading/trailing spaces */
tmpstartpos = 0;
- for (i = 0; i < strlen(str); i++)
+ for (i = 0; i < str_len; i++)
{
if (str[i] != ' ')
{
diff --cc regress/core/lwgeom_regress.sql
index 3c647e3c8,3c647e3c8..d7de1a420
--- a/regress/core/lwgeom_regress.sql
+++ b/regress/core/lwgeom_regress.sql
@@@ -220,4 -220,4 +220,5 @@@ select 'typmod_point_-1', geometry_typm
select 'typmod_pointzm_0', geometry_typmod_out(geometry_typmod_in('{PointZM,0}'));
select 'typmod_geometry_0', geometry_typmod_out(geometry_typmod_in('{Geometry,0}'));
select 'typmod_geometry_4326', geometry_typmod_out(geometry_typmod_in('{Geometry,4326}'));
++select 'typmod_empty', geometry_typmod_out(geometry_typmod_in('{""}'));
select 'typmod_geography_0', geometry_typmod_out(geometry_typmod_in('{Geogrpahy,0}'));
diff --cc regress/core/lwgeom_regress_expected
index 8239d0fec,8239d0fec..e04017250
--- a/regress/core/lwgeom_regress_expected
+++ b/regress/core/lwgeom_regress_expected
@@@ -57,4 -57,4 +57,5 @@@ typmod_point_-1|(Point
typmod_pointzm_0|(PointZM)
typmod_geometry_0|
typmod_geometry_4326|(Geometry,4326)
++ERROR: Invalid geometry type modifier:
ERROR: Invalid geometry type modifier: Geogrpahy
commit 269bafce80a93c5b38ab2b05975056dcc1c5c1a1
Author: Egor Ivkov <e.ivkov at arenadata.io>
Date: Mon Aug 31 16:56:34 2026 +0300
Add CUnit coverage for empty geometry type strings
Covers the empty and all-spaces type modifiers rejected by the
previous commit.
diff --git a/liblwgeom/cunit/cu_gserialized1.c b/liblwgeom/cunit/cu_gserialized1.c
index c31228c75..72840c670 100644
--- a/liblwgeom/cunit/cu_gserialized1.c
+++ b/liblwgeom/cunit/cu_gserialized1.c
@@ -444,6 +444,14 @@ static void test_geometry_type_from_string(void)
//printf("\n in type: %s\nout type: %d\n out z: %d\n out m: %d", str, type, z, m);
CU_ASSERT_EQUAL(rv, LW_FAILURE);
+ str = "";
+ rv = geometry_type_from_string(str, &type, &z, &m);
+ CU_ASSERT_EQUAL(rv, LW_FAILURE);
+
+ str = " ";
+ rv = geometry_type_from_string(str, &type, &z, &m);
+ CU_ASSERT_EQUAL(rv, LW_FAILURE);
+
}
static void test_lwgeom_count_vertices(void)
commit 828d586e6cb8c3941b3b6f7c1df1c6d94db546ed
Author: Egor Ivkov <e.ivkov at arenadata.io>
Date: Wed Aug 5 17:20:48 2026 +0300
geometry_type_from_string: reject empty input
For an empty string strlen(str) - 1 underflows the unsigned index, and
the loop that skips trailing spaces then dereferences str at that index,
far past its end. An empty type modifier reaches this function without
any prior check, so reject it explicitly.
diff --git a/liblwgeom/lwutil.c b/liblwgeom/lwutil.c
index 514976d1c..a175dc1ba 100644
--- a/liblwgeom/lwutil.c
+++ b/liblwgeom/lwutil.c
@@ -471,12 +471,18 @@ int geometry_type_from_string(const char *str, uint8_t *type, int *z, int *m)
char *tmpstr;
size_t tmpstartpos, tmpendpos;
size_t i;
+ size_t str_len;
assert(str);
assert(type);
assert(z);
assert(m);
+ str_len = strlen(str);
+ /* Empty string is not a valid type */
+ if(str_len == 0)
+ return LW_FAILURE;
+
/* Initialize. */
*type = 0;
*z = 0;
@@ -484,7 +490,7 @@ int geometry_type_from_string(const char *str, uint8_t *type, int *z, int *m)
/* Locate any leading/trailing spaces */
tmpstartpos = 0;
- for (i = 0; i < strlen(str); i++)
+ for (i = 0; i < str_len; i++)
{
if (str[i] != ' ')
{
@@ -493,8 +499,8 @@ int geometry_type_from_string(const char *str, uint8_t *type, int *z, int *m)
}
}
- tmpendpos = strlen(str) - 1;
- for (i = strlen(str) - 1; i != 0; i--)
+ tmpendpos = str_len - 1;
+ for (i = str_len - 1; i != 0; i--)
{
if (str[i] != ' ')
{
-----------------------------------------------------------------------
Summary of changes:
.mailmap | 2 ++
NEWS | 2 ++
liblwgeom/cunit/cu_gserialized1.c | 14 ++++++++++++++
liblwgeom/lwutil.c | 12 +++++++++---
regress/core/lwgeom_regress.sql | 1 +
regress/core/lwgeom_regress_expected | 1 +
6 files changed, 29 insertions(+), 3 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list