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.
StreamReadConstraints: add maxStringLen #864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StreamReadConstraints: add maxStringLen #864
Changes from all commits
0ace988
39e0615
2361a6a
2c24999
9089481
72e1765
9b8598f
99e6af1
d0184b9
cef6270
800c7f6
02b0fdc
9626ada
45178f8
d02f9ac
99d9b72
5fc9289
287bca2
1be0115
2dbb68e
e95d9f4
75d4b5b
a83e816
93d358b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cowtowncoder the test I added to passes when it is run by itself but fails when it is run with other tests. It seems that running other tests with the default StreamReadConstraints seems to leave behind state - maybe in the BufferRecyclers - that means the validateStringLength checks don't get called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, due to buffer recycling it is possible that recycled buffer has reached size of up to 64k chars.
So test will probably be set as much less strict: to set maximum length to say 100k, produce 200k String and verify that gets caught.
Another thing we could consider: making
MAX_SEGMENT_LEN
no higher thanmaxStringLength
.Then again... maybe not worth bothering yet.