feat(go): add size guardrails for strings, collections and maps#3423
Draft
Zakir032002 wants to merge 5 commits intoapache:mainfrom
Draft
feat(go): add size guardrails for strings, collections and maps#3423Zakir032002 wants to merge 5 commits intoapache:mainfrom
Zakir032002 wants to merge 5 commits intoapache:mainfrom
Conversation
Add three opt-in guardrail fields to Config and three corresponding WithXxx option functions. All default to 0 (unlimited), preserving full backward compatibility. Enforcement in read paths follows in subsequent commits.
chaokunyang
reviewed
Feb 28, 2026
go/fory/fory.go
Outdated
| MaxDepth int | ||
| IsXlang bool | ||
| Compatible bool // Schema evolution compatibility mode | ||
| MaxStringBytes int |
Collaborator
There was a problem hiding this comment.
I updated issue, could you simplify to MaxBinarySize and MaxCollectionSize only
8c7fd1d to
3c5f854
Compare
3c5f854 to
aa315de
Compare
The checkBinarySize method in ReadContext was never called from any deserializer path. Per maintainer guidance, size checks are only needed at preallocation sites. The MaxBinarySize config field and WithMaxBinarySize option are retained as reserved API.
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.
Why?
Closes #3419
What does this PR do?
Related issues
Does this PR introduce any user-facing change?
Benchmark