Skip to content

Fix #1014: increase max string value length from 5 to 20 million characters #1020

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 1 commit into from
May 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ JSON library.
`ch.randelshofer:fastdoubleparser`
(reported by Chris R)
#1003: Add FastDoubleParser section to `NOTICE`
#1014: Increase default max allowed String value length from 5 megs to 20 megs

2.15.0 (23-Apr-2023)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* <ul>
* <li>Maximum Number value length: default 1000 (see {@link #DEFAULT_MAX_NUM_LEN})
* </li>
* <li>Maximum String value length: default 5_000_000 (see {@link #DEFAULT_MAX_STRING_LEN})
* <li>Maximum String value length: default 20_000_000 (see {@link #DEFAULT_MAX_STRING_LEN})
* </li>
* <li>Maximum Nesting depth: default 1000 (see {@link #DEFAULT_MAX_DEPTH})
* </li>
Expand All @@ -38,9 +38,12 @@ public class StreamReadConstraints
public static final int DEFAULT_MAX_NUM_LEN = 1000;

/**
* Default setting for maximum string length: see {@link Builder#maxStringLength(int)} for details.
* Default setting for maximum string length: see {@link Builder#maxStringLength(int)}
* for details.
*<p>
* NOTE: Jackson 2.15.0 initially used a lower setting (5_000_000).
*/
public static final int DEFAULT_MAX_STRING_LEN = 5_000_000;
public static final int DEFAULT_MAX_STRING_LEN = 20_000_000;

/**
* Limit for the maximum magnitude of Scale of {@link java.math.BigDecimal} that can be
Expand Down Expand Up @@ -98,13 +101,15 @@ public Builder maxNumberLength(final int maxNumLen) {

/**
* Sets the maximum string length (in chars or bytes, depending on input context).
* The default is 5,000,000. This limit is not exact, the limit is applied when we increase
* The default is 20,000,000. This limit is not exact, the limit is applied when we increase
* internal buffer sizes and an exception will happen at sizes greater than this limit. Some
* text values that are a little bigger than the limit may be treated as valid but no text
* values with sizes less than or equal to this limit will be treated as invalid.
* <p>
* Setting this value to lower than the {@link #maxNumberLength(int)} is not recommended.
* </p>
*<p>
* NOTE: Jackson 2.15.0 initially used a lower setting (5_000_000).
*
* @param maxStringLen the maximum string length (in chars or bytes, depending on input context)
*
Expand Down