Repository navigation
fix: Decode accepts the largest size limit - #5
Merged
Merged
Conversation
WithMaxSize(math.MaxInt64) made the size check compute n+1, which overflowed to a negative bound and panicked on the first read. The check now compares against n and only slices to n+1 when that is smaller than the buffer. Claude-Session: https://claude.ai/code/session_0168DfDKifRapP2xPKwZ8anF
Julian Köhn (juliankoehn)
pushed a commit
that referenced
this pull request
Oct 15, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.1](esdscom-v0.1.0...esdscom-v0.1.1) (2026-10-15) ### Bug Fixes * Decode accepts the largest size limit ([#5](#5)) ([4d3cd87](4d3cd87)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: velcure-release[bot] <342924300+velcure-release[bot]@users.noreply.github.com>
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.
WithMaxSize(math.MaxInt64)made the size check inlimitReadercomputen+1, which overflowed to a negative bound and panicked on the first read. The check now compares againstnand only slices ton+1when that is smaller than the buffer.The test in
TestDecodeRejectsdecodes the minimal document with the largest limit; it panicked before the fix.https://claude.ai/code/session_0168DfDKifRapP2xPKwZ8anF