Conversation
Contributor
Author
matthiasgoergens
force-pushed
the
review/duckdb-spatial-wkb-trailing-data
branch
from
September 17, 2026 01:57
33b69c0 to
3e19894
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spatial's SGL reader returned success as soon as it finished the outermost WKB
geometry, even when bytes remained in the input. The 2D constructors,
ST_GeomFromHEXWKB, and statistics parsing could consequently accept a validgeometry followed by arbitrary data or a second geometry.
Require the parser position to reach the end of the supplied buffer in both
the materialising and statistics paths, and report a specific trailing-data
error otherwise. The standalone regression also verifies the error category,
message, and successful reader reuse after a rejected input.
The standalone Clang ASan/UBSan suite and the full Spatial
relassertbuildpass. Focused SQL coverage exercises all three 2D constructors and HEX WKB;
the adjacent WKB round-trip suites also pass.
Related: duckdb/duckdb#24296 and duckdb/duckdb#24301 — the corresponding
DuckDB core
ST_GeomFromWKBpath is fixed separately in duckdb/duckdb#24559.Verified (2026-08-05):
test/sql/geometry/st_2d_fromwkb.testandtest/sql/geometry/st_ashexwkb.testfail on unpatched duckdb-spatial main2b072abd2a(trailing bytes silently accepted, e.g. a point followed bygarbage still returns
POINT_2D {'x': 1.0, 'y': 2.0}) and pass with thisbranch (6 and 27 assertions).