Skip to content

Conversation

@marcoferrer
Copy link

@marcoferrer marcoferrer commented Aug 11, 2025

msg.Unmarshal() returns variable length integer overflow when decoding proto extension with a field number below the protowire.MaxValidNumber const. This is because the tag.Overflows() check incorrectly calculated the max number of leading zeros for the field number

Issue with more context: #18

@doriable doriable changed the title bug fix tag overflow checks Fix bug in tag overflow checks Aug 14, 2025
Copy link
Member

@mcy mcy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please expand the PR description to detail why this change is necessary. I prefer to have detailed commit messages that are self-contained.

@mcy
Copy link
Member

mcy commented Aug 18, 2025

Also, could you include a test in internal/testdata/tags that exercises this behavior? I like to have end-to-end tests for these kinds of corner-cases.

@marcoferrer marcoferrer requested a review from mcy October 10, 2025 15:21
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.

2 participants