[SCM] PostGIS branch stable-3.5 updated. 3.5.7-95-g196973e23c

git at osgeo.org git at osgeo.org
Tue Jul 28 09:11:15 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.5 has been updated
       via  196973e23c5e330058d25ee44dad8bf6d8b578ff (commit)
       via  4a318b7873a38947b0c7db3f34853f80ec1773c3 (commit)
      from  fc7e2570210368a0bed13c83bb24bb77b580c566 (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 196973e23c5e330058d25ee44dad8bf6d8b578ff
Merge: fc7e257021 4a318b7873
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Tue Jul 28 09:11:13 2026 -0700

    Merge pull request 'Initialize GSERIALIZED peek test fixtures on stable-3.5' (!609) from Komzpa/postgis:fix/gserialized-peek-valgrind-stable-3.5-20260728 into stable-3.5
    
    This backports the master fixture initialization from https://gitea.osgeo.org/postgis/postgis/pulls/569 to stable-3.5.
    
    The safety backport made the GSERIALIZED peek code validate payload bounds using the serialized size. The CUnit fixtures were manually allocated and then filled from the payload onward, leaving the header size and SRID bytes uninitialized. Valgrind therefore reported uninitialized reads in the unit test fixture even though the bounds-checking code is doing the right thing.
    
    The fix initializes the handcrafted GSERIALIZED header before writing the payload, matching master. The stable-3.5 NEWS entry cites GT-569, the master pull request number.
    
    Tested with `make -C liblwgeom check-unit CUNIT_WITH_VALGRIND=YES CUNIT_VALGRIND_FLAGS='--leak-check=full --error-exitcode=1'`.
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/609


commit 4a318b7873a38947b0c7db3f34853f80ec1773c3
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Tue Jul 28 02:24:34 2026 +0400

    Initialize GSERIALIZED peek test fixtures

diff --git a/NEWS b/NEWS
index 744a3e5311..e827053fcd 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PostGIS 3.5.8
 
 * Bug Fixes *
 
+  - GT-569, Initialize GSERIALIZED peek test fixtures so check-unit stays
+    clean under Valgrind (Darafei Praliaskouski)
   - GT-575, Scope interrupt regression timeouts to the statements being
     canceled (Darafei Praliaskouski)
   - GT-522, Reject malformed GSERIALIZED payload counts before deserializing
diff --git a/liblwgeom/cunit/cu_gserialized1.c b/liblwgeom/cunit/cu_gserialized1.c
index fe5c2ca413..06ee820960 100644
--- a/liblwgeom/cunit/cu_gserialized1.c
+++ b/liblwgeom/cunit/cu_gserialized1.c
@@ -1183,10 +1183,13 @@ static void test_gserialized1_peek_gbox_p_fails_for_unsupported_cases(void)
 		GSERIALIZED* gser = lwalloc(expected_size);
 		uint8_t* ptr = (uint8_t*) gser;
 
-		ptr += 8; // Skip header
-		gserialized1_from_lwgeom_any(geom, ptr);
+		gser->size = expected_size << 2;
+		gserialized1_set_srid(gser, geom->srid);
 		gser->gflags = lwflags_get_g1flags(geom->flags);
 
+		ptr += 8; /* Skip header */
+		gserialized1_from_lwgeom_any(geom, ptr);
+
 		CU_ASSERT_FALSE(gserialized1_has_bbox(gser));
 		CU_ASSERT_EQUAL(LW_FAILURE, gserialized1_peek_gbox_p(gser, &box));
 
diff --git a/liblwgeom/cunit/cu_gserialized2.c b/liblwgeom/cunit/cu_gserialized2.c
index 6ffdc5badc..44be675094 100644
--- a/liblwgeom/cunit/cu_gserialized2.c
+++ b/liblwgeom/cunit/cu_gserialized2.c
@@ -449,10 +449,13 @@ static void test_gserialized2_peek_gbox_p_fails_for_unsupported_cases(void)
 		GSERIALIZED* gser = lwalloc(expected_size);
 		uint8_t* ptr = (uint8_t*) gser;
 
-		ptr += 8; // Skip header
-		gserialized2_from_lwgeom_any(geom, ptr);
+		LWSIZE_SET(gser->size, expected_size);
+		gserialized2_set_srid(gser, geom->srid);
 		gser->gflags = lwflags_get_g2flags(geom->flags);
 
+		ptr += 8; /* Skip header */
+		gserialized2_from_lwgeom_any(geom, ptr);
+
 		CU_ASSERT_FALSE(gserialized2_has_bbox(gser));
 		CU_ASSERT_EQUAL(LW_FAILURE, gserialized2_peek_gbox_p(gser, &box));
 

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

Summary of changes:
 NEWS                              | 2 ++
 liblwgeom/cunit/cu_gserialized1.c | 7 +++++--
 liblwgeom/cunit/cu_gserialized2.c | 7 +++++--
 3 files changed, 12 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list