Skip to content

Commit

Permalink
Fix #1014: increase max string value length from 5 to 20 million char…
Browse files Browse the repository at this point in the history
…acters (#1020)
  • Loading branch information
cowtowncoder authored May 14, 2023
1 parent cd8494a commit 0484754
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
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

0 comments on commit 0484754

Please sign in to comment.