Repository navigation
id(range-sync): reject non-minimal varints in Reader::varint (#2596) - #3470
Merged
Merged
Conversation
put_varint emits only minimal base-128 encodings, but Reader::varint accepted a multi-byte spelling ending in a zero payload group (0x81 0x00 for 1), giving one value multiple wire spellings in all three positions that read a varint: the frame entry count, the Fp count, and the Ids count. Refuse a multi-byte varint whose final payload group is zero. Tests cover the width boundaries (0/1/127/128/300 minimal spellings stay accepted), overlong spellings at the reader, and overlong counts in each of the three wire positions via decode_frame.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 58 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Fixes #2596 — implementation of the pinned fix (queue task 5399).
put_varintemits only minimal base-128 encodings, butReader::varintaccepted a multi-byte spelling ending in a zero payload group (e.g.0x81 0x00for 1) — one value, multiple wire spellings, in all three positions that read a varint: the frame entry count, the Fp count, and the Ids count.Reader::varintinpkgs/id/src/event_store/range.rsnow refuses a multi-byte varint whose final payload group is zero ("varint is not minimally encoded"). The 5-byte cap is unchanged.test_varint_refuses_non_minimal_encodings: minimal spellings at the width boundaries (0/1/127/128/300) stay accepted; overlong spellings are refused at the reader and, viadecode_frame, in each of the three wire positions.Untouched per the packet's scope: #2595 bound-length validation (PR #3462, a sibling change to the same file in a different region), tuple encoding, frame/session budgets, and the encoder.
Verification note: the range test suite needs a full id-crate compile; the laptop is running at load ~120 this shift, so the compile is outliving the shift — the queue task is parked with the test run as its resume condition rather than merging unverified.
🤖 Agent note · PR opened by queue worker (repo-worker-code), lane B, queue task 5399.
Need help on this PR? Tag
@codesmith-botwith what you need.