postgis.git / summary / log / commit / refs

commit    c1e91f8b1e5612e8d7ec50b3a7705cab232103db
Author:   Darafei Praliaskouski <komzpa@gmail.com>
Date:     Sat Aug 01 18:10:36 2026 +0000

    Merge pull request 'liblwgeom: validate serialized NURBS invariants' (!640) from Komzpa/postgis:oss-fuzz-4885548695879680 into master
    
    Reject malformed GSERIALIZED v2 NURBS payloads before they can reach curve evaluation and bbox calculation. The validator now mirrors the constructor invariants for degree, control-point count, optional weight count, optional knot count, finite positive weights, and finite nondecreasing knots.
    
    This fixes the OSS-Fuzz gserialized_from_bytea_fuzzer testcase that reached lwnurbscurve_evaluate via lwgeom_calculate_gbox_cartesian.
    
    Affected releases: this is on the unreleased 3.7 development line. The maintained stable branches stable-3.2 through stable-3.6 do not contain the NURBS curve code path, and there is currently no stable-3.7 branch to backpatch.
    
    Validation:
    
    - clang ASAN focused build: ./configure CC=clang CXX=clang++ --without-raster --without-topology --without-sfcgal CFLAGS="-g3 -O0 -fno-omit-frame-pointer -fsanitize=address" CXXFLAGS="-g3 -O0 -fno-omit-frame-pointer -fsanitize=address" LDFLAGS="-fsanitize=address"
    - ./liblwgeom/cunit/cu_tester "serialization/deserialization v2" — 16 passed, 0 failed, 462 asserts
    - ./liblwgeom/cunit/cu_tester test_gserialized2_malformed_nurbs_degree — 9 asserts passed
    - tmp-fuzz-out/gserialized_from_bytea_fuzzer clusterfuzz-testcase-minimized-gserialized_from_bytea_fuzzer-4885548695879680 — exit 0
    
    Credit to OSS-Fuzz: https://oss-fuzz.com/testcase?key=4885548695879680
    
    Reviewed-on: https://gitea.osgeo.org/postgis/postgis/pulls/640


NEWS | 2 + liblwgeom/cunit/cu_gserialized2.c | 25 +++++++++++ liblwgeom/gserialized2.c | 92 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 118 insertions(+), 1 deletion(-) [parent: 1df65a1b92af]