[SCM] PostGIS branch master updated. 3.7.0beta1-288-ga9fc28c341

git at osgeo.org git at osgeo.org
Sun Aug 9 13:53:50 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  a9fc28c341713aa70bfd43ad1200d9fdd4559400 (commit)
       via  b3aa5da4ddaddd7d5d88f6d38cb991c8974ed809 (commit)
      from  1fce5eae5fa48ee513913b0bce7c6ac6eee000b5 (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 a9fc28c341713aa70bfd43ad1200d9fdd4559400
Merge: 1fce5eae5f b3aa5da4dd
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sun Aug 9 13:53:48 2026 -0700

    Merge pull request 'fuzzers: compare GSERIALIZED bytea round trips semantically' (!704) from Komzpa/postgis:fix/ossfuzz-gserialized-bytea-544223869 into master
    
    ## Summary
    
    OSS-Fuzz issue 544223869 found that `gserialized_from_bytea_fuzzer` could abort on an assertion while round-tripping arbitrary GSERIALIZED input through WKB bytea.
    
    The testcase carries GSERIALIZED bbox metadata that is not preserved by WKB bytea output. This patch keeps the fuzzer's serializer size checks, but compares the bytea round trip by geometry metadata and coordinate semantics after dropping bbox metadata instead of requiring byte-for-byte GSERIALIZED equality.
    
    `NEWS` is updated under the unreleased 3.7.0beta2 bug-fix section.
    
    ## Validation
    
    - `git clang-format --extensions cpp --diff upstream/master`
    - `make -C fuzzers dummyfuzzers FUZZER_OUT=...`
    - `gserialized_from_bytea_fuzzer` replay of testcase 6383202993504256
    - `make -C fuzzers check-corpus FUZZER_OUT=...`
    - `git diff --check upstream/master`
    - `utils/check_news.sh .`
    - `make check-contributor-credits`
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/704


commit b3aa5da4ddaddd7d5d88f6d38cb991c8974ed809
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Mon Aug 10 00:50:07 2026 +0400

    fuzzers: compare GSERIALIZED bytea round trips semantically
    
    OSS-Fuzz issue 544223869 exposed that arbitrary GSERIALIZED input may carry bbox metadata that is not preserved by WKB bytea output. Keep serializer size checks, but compare the round-tripped geometry metadata and coordinates after dropping bbox metadata.

diff --git a/NEWS b/NEWS
index f5a8cbbc25..69e2923566 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ These are only changes since 3.7.0beta1.
 
 * Bug Fixes *
 
+ - OSSFuzz 544223869, compare GSERIALIZED bytea round trips by geometry
+          semantics instead of volatile bbox bytes (Darafei Praliaskouski)
  - GT-675, Preserve TRIANGLE children while normalizing malformed TINs
           (Darafei Praliaskouski)
  - GT-677, Fix memory leaks in ST_GeometryN and ST_DWithin
diff --git a/fuzzers/gserialized_from_bytea_fuzzer.cpp b/fuzzers/gserialized_from_bytea_fuzzer.cpp
index 41c37ea859..087f97d3e3 100644
--- a/fuzzers/gserialized_from_bytea_fuzzer.cpp
+++ b/fuzzers/gserialized_from_bytea_fuzzer.cpp
@@ -48,15 +48,6 @@ geometry_to_bytea(const LWGEOM *lwgeom)
 	return lwgeom_to_wkb_varlena(lwgeom, WKB_NDR | WKB_EXTENDED);
 }
 
-static void
-assert_equal_gserialized(const GSERIALIZED *left, size_t left_size, const GSERIALIZED *right, size_t right_size)
-{
-	postgis_fuzzer_assert(left_size == LWSIZE_GET(left->size));
-	postgis_fuzzer_assert(right_size == LWSIZE_GET(right->size));
-	postgis_fuzzer_assert(left_size == right_size);
-	postgis_fuzzer_assert(memcmp(left, right, left_size) == 0);
-}
-
 static void
 assert_gserialized_bytea_roundtrip(LWGEOM *lwgeom)
 {
@@ -74,7 +65,21 @@ assert_gserialized_bytea_roundtrip(LWGEOM *lwgeom)
 
 	GSERIALIZED *second = gserialized_from_lwgeom(from_bytea, &second_size);
 	postgis_fuzzer_assert(second != NULL);
-	assert_equal_gserialized(first, first_size, second, second_size);
+	postgis_fuzzer_assert(first_size == LWSIZE_GET(first->size));
+	postgis_fuzzer_assert(second_size == LWSIZE_GET(second->size));
+	postgis_fuzzer_assert(lwgeom->type == from_bytea->type);
+	postgis_fuzzer_assert(lwgeom->srid == from_bytea->srid);
+	postgis_fuzzer_assert(FLAGS_GET_Z(lwgeom->flags) == FLAGS_GET_Z(from_bytea->flags));
+	postgis_fuzzer_assert(FLAGS_GET_M(lwgeom->flags) == FLAGS_GET_M(from_bytea->flags));
+	postgis_fuzzer_assert(FLAGS_GET_GEODETIC(lwgeom->flags) == FLAGS_GET_GEODETIC(from_bytea->flags));
+
+	/* WKB bytea does not preserve GSERIALIZED bounding boxes. Arbitrary
+	 * GSERIALIZED input can carry a bbox that is not byte-for-byte reproduced
+	 * after geometry->bytea->geometry, so compare the semantic geometry.
+	 */
+	lwgeom_drop_bbox(lwgeom);
+	lwgeom_drop_bbox(from_bytea);
+	postgis_fuzzer_assert(lwgeom_same(lwgeom, from_bytea));
 
 	lwgeom_free(from_bytea);
 	lwfree(first);

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

Summary of changes:
 NEWS                                      |  2 ++
 fuzzers/gserialized_from_bytea_fuzzer.cpp | 25 +++++++++++++++----------
 2 files changed, 17 insertions(+), 10 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list