Repository navigation
[Java] Reject a group blockLength below the fields of the acting version - #1153
Open
slachiewicz wants to merge 4 commits into
Open
slachiewicz wants to merge 4 commits into
slachiewicz wants to merge 4 commits into
Conversation
slachiewicz
force-pushed
the
java-group-block-length-check
branch
2 times, most recently
from
November 19, 2026 21:00
f09181d to
10844b5
Compare
…ion. The minimum is version-aware so older senders with shorter blocks still decode, and it excludes constant fields, which have no bytes on the wire.
slachiewicz
force-pushed
the
java-group-block-length-check
branch
from
November 27, 2026 15:17
10844b5 to
8ef764d
Compare
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.
Generated group decoders accepted any blockLength. With blockLength 0, every element overlaps the next, so a small frame of nested group headers expands into millions of elements in toString() or other full walks. The group wrap now rejects a non-empty group whose blockLength is smaller than the fields present at the acting version.
The minimum depends on the version, so a block from an older sender that ends before later fields, or before composite members added in a later version, still decodes. Constant fields are left out because they have no bytes on the wire. A decoder that passes its own schema version as the acting version, rather than the version from the header, now rejects shorter blocks from older senders.
Part of #969.
Verified: GroupBlockLengthTest fails on master (8 of 14 cases) and passes here; sbe-tool checkstyle, tests, verifyJavaIrCodecsInSync, sbe-samples check and sbe-benchmarks compile pass.