-
-
Notifications
You must be signed in to change notification settings - Fork 812
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
Merged
Merged
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0ace988
add maxStringLen
pjfanning 39e0615
start refactor
pjfanning 2361a6a
add ReadConstrainedTextBuffer
pjfanning 2c24999
check for string length in append methods
pjfanning 9089481
revert some changes
pjfanning 72e1765
Merge branch '2.15' into max-string-size
pjfanning 9b8598f
javadoc
pjfanning 99e6af1
Update TextBuffer.java
pjfanning d0184b9
Update TextBuffer.java
pjfanning cef6270
Update TextBuffer.java
pjfanning 800c7f6
Merge branch '2.15' into max-string-size
pjfanning 02b0fdc
Merge branch '2.15' into max-string-size
pjfanning 9626ada
Merge branch '2.15' into max-string-size
pjfanning 45178f8
remove append checks (don't seem to help much)
pjfanning d02f9ac
remove number check
pjfanning 99d9b72
Merge branch '2.15' into max-string-size
pjfanning 5fc9289
Merge branch '2.15' into max-string-size
pjfanning 287bca2
increase limit to 10m
pjfanning 1be0115
add 1 test
pjfanning 2dbb68e
Update StreamReadConstraints.java
pjfanning e95d9f4
Update AsyncStringArrayTest.java
pjfanning 75d4b5b
Merge branch '2.15' into max-string-size
pjfanning a83e816
change default limit back to 1m
pjfanning 93d358b
check string len in more places
pjfanning File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
47 changes: 47 additions & 0 deletions
47
src/main/java/com/fasterxml/jackson/core/util/ReadConstrainedTextBuffer.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.fasterxml.jackson.core.util; | ||
|
||
import com.fasterxml.jackson.core.StreamReadConstraints; | ||
|
||
public final class ReadConstrainedTextBuffer extends TextBuffer { | ||
|
||
private final StreamReadConstraints _streamReadConstraints; | ||
|
||
public ReadConstrainedTextBuffer(StreamReadConstraints streamReadConstraints, BufferRecycler bufferRecycler) { | ||
super(bufferRecycler); | ||
_streamReadConstraints = streamReadConstraints; | ||
} | ||
|
||
/* | ||
/********************************************************************** | ||
/* Convenience methods for validation | ||
/********************************************************************** | ||
*/ | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected void validateFPLength(int length) throws NumberFormatException | ||
{ | ||
_streamReadConstraints.validateFPLength(length); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected void validateIntegerLength(int length) throws NumberFormatException | ||
{ | ||
_streamReadConstraints.validateIntegerLength(length); | ||
} | ||
|
||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
protected void validateStringLength(int length) throws IllegalStateException | ||
{ | ||
_streamReadConstraints.validateStringLength(length); | ||
} | ||
} |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.