[SCM] PostGIS branch master updated. 3.7.0beta1-244-g239c3ddb03

git at osgeo.org git at osgeo.org
Sat Aug 8 02:11:48 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  239c3ddb0370b02d2dabda0aafa31dc35423bed0 (commit)
       via  9e37955b883e7a0e26572da77afbac71ae593b62 (commit)
      from  d44fea5336f85fde27e59e4bd82d210a6c671f80 (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 239c3ddb0370b02d2dabda0aafa31dc35423bed0
Merge: d44fea5336 9e37955b88
Author: Darafei Praliaskouski <komzpa at gmail.com>
Date:   Sat Aug 8 02:11:46 2026 -0700

    Merge pull request 'fuzzers: account for GSERIALIZED bbox rounding' (!668) from Komzpa/postgis:fix/gserialized-roundtrip-fuzzer-540015204 into master
    
    ## Summary
    
    Avoid a false abort in the GSERIALIZED round-trip fuzzer when the serialized
    bounding box is rounded outward to float precision.
    
    The fuzzer now checks the expected rounded bounding box and compares geometry
    coordinates without the cached bounding box. It also no longer requires
    byte-for-byte WKB equality across a round trip, because WKB serialization
    canonically rewrites NaN payloads.
    
    ## Validation
    
    - Replayed the reported OSS-Fuzz testcase successfully.
    - Ran the target with no input successfully.
    
    References https://oss-fuzz.com/testcase-detail/6302177757560832
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/668


commit 9e37955b883e7a0e26572da77afbac71ae593b62
Author: Darafei Praliaskouski <me at komzpa.net>
Date:   Sat Aug 8 12:58:18 2026 +0400

    fuzzers: account for GSERIALIZED bbox rounding
    
    Credit to OSS-Fuzz: https://oss-fuzz.com/testcase-detail/6302177757560832

diff --git a/NEWS b/NEWS
index 0bb868dbe9..0d9e68a988 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ These are only changes since 3.7.0beta1.
 
 * Bug Fixes *
 
+ - OSSFuzz 6302177757560832, account for GSERIALIZED float bbox rounding
+          in fuzzer round trips (Darafei Praliaskouski)
  - Stop the extension upgrade script running ANALYZE inside its transaction,
           where it could deadlock with autovacuum (Darafei Praliaskouski)
  - [liblwgeom] Reject malformed GSERIALIZED NURBS before curve
diff --git a/fuzzers/gserialized_from_lwgeom_fuzzer.cpp b/fuzzers/gserialized_from_lwgeom_fuzzer.cpp
index 0ac1454abf..b6f2445c57 100644
--- a/fuzzers/gserialized_from_lwgeom_fuzzer.cpp
+++ b/fuzzers/gserialized_from_lwgeom_fuzzer.cpp
@@ -16,7 +16,6 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include <string.h>
 
 extern "C" {
 #include "geos_stub.h"
@@ -43,27 +42,11 @@ postgis_fuzzer_assert(int condition)
 		abort();
 }
 
-static lwvarlena_t *
-geometry_to_bytea(const LWGEOM *lwgeom)
-{
-	return lwgeom_to_wkb_varlena(lwgeom, WKB_NDR | WKB_EXTENDED);
-}
-
-static void
-assert_equal_bytea(const lwvarlena_t *left, const lwvarlena_t *right)
-{
-	size_t left_size = LWSIZE_GET(left->size);
-	size_t right_size = LWSIZE_GET(right->size);
-
-	postgis_fuzzer_assert(left_size >= LWVARHDRSZ);
-	postgis_fuzzer_assert(right_size >= LWVARHDRSZ);
-	postgis_fuzzer_assert(left_size == right_size);
-	postgis_fuzzer_assert(memcmp(left->data, right->data, left_size - LWVARHDRSZ) == 0);
-}
-
 static void
 assert_matching_gbox(const LWGEOM *input, const LWGEOM *roundtrip)
 {
+	GBOX expected;
+
 	if (input->bbox == NULL || roundtrip->bbox == NULL)
 	{
 		postgis_fuzzer_assert(input->bbox == NULL);
@@ -71,7 +54,10 @@ assert_matching_gbox(const LWGEOM *input, const LWGEOM *roundtrip)
 		return;
 	}
 
-	postgis_fuzzer_assert(gbox_same(input->bbox, roundtrip->bbox));
+	/* GSERIALIZED stores a float-rounded bbox. */
+	expected = *input->bbox;
+	gbox_float_round(&expected);
+	postgis_fuzzer_assert(gbox_same(&expected, roundtrip->bbox));
 }
 
 static void
@@ -112,19 +98,14 @@ LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len)
 	postgis_fuzzer_assert(roundtrip != NULL);
 	assert_matching_metadata(input, roundtrip);
 	assert_matching_gbox(input, roundtrip);
+	/* Compare the coordinate data without the intentionally rounded bbox. */
+	lwgeom_drop_bbox(input);
+	lwgeom_drop_bbox(roundtrip);
 	postgis_fuzzer_assert(lwgeom_same(input, roundtrip));
 
-	lwvarlena_t *input_bytea = geometry_to_bytea(input);
-	lwvarlena_t *roundtrip_bytea = geometry_to_bytea(roundtrip);
-	postgis_fuzzer_assert(input_bytea != NULL);
-	postgis_fuzzer_assert(roundtrip_bytea != NULL);
-	assert_equal_bytea(input_bytea, roundtrip_bytea);
-
 	lwgeom_free(input);
 	lwgeom_free(roundtrip);
 	lwfree(serialized);
-	lwfree(input_bytea);
-	lwfree(roundtrip_bytea);
 	postgis_lwgeom_fuzzer_cleanup_allocations();
 	return 0;
 }

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

Summary of changes:
 NEWS                                       |  2 ++
 fuzzers/gserialized_from_lwgeom_fuzzer.cpp | 37 ++++++++----------------------
 2 files changed, 11 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list