Skip to content

[Go] Reject generated flyweight group headers whose blockLength is below the fixed fields - #1188

Open
slachiewicz wants to merge 1 commit into
aeron-io:masterfrom
slachiewicz:go-flyweight-group-block-length-check
Open

slachiewicz wants to merge 1 commit into
aeron-io:masterfrom
slachiewicz:go-flyweight-group-block-length-check

Conversation

@slachiewicz

Copy link
Copy Markdown
Contributor

The generated Go flyweight group WrapForDecode stored the wire blockLength and count unchecked, so a header with a zero blockLength let Next and ForEach hand out any number of entries aliasing the same bytes. The generator now emits a check that panics when the group has entries and its blockLength is below the fixed fields present at the acting version, computed per schema version so composite members added later and constant fields do not count.

Part of #969.

Verified: TestGroupBlockLengthMustCoverFieldsAtActingVersion fails on master (three expected panics missing) and passes here; checkstyle, :sbe-tool:test, verifyJavaIrCodecsInSync, :sbe-samples:check and gocode make pass.

…low the fixed fields.

WrapForDecode now panics when a group with entries has a blockLength smaller than the fields present at the acting version, so Next cannot hand out entries aliasing the same bytes. Constant fields and composite members newer than the acting version must stay excluded.
@slachiewicz
slachiewicz force-pushed the go-flyweight-group-block-length-check branch from dbba049 to 08b783a Compare November 19, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant