File tree Expand file tree Collapse file tree 4 files changed +9
-10
lines changed
main/java/tools/jackson/core/json
test/java/tools/jackson/core/unittest/constraints Expand file tree Collapse file tree 4 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ JSON library.
1919
2020#1548: `StreamReadConstraints.maxDocumentLength` not checked when
2121 creating parser with fixed buffer
22+ #1553: Max Depth validation not working for `DataInput`-backed `JsonParser`s
23+ in 3.0
2224
23253.1.0-rc1 (27-Jan-2026)
2426
Original file line number Diff line number Diff line change @@ -1262,9 +1262,9 @@ public final long nextLongValue(long defaultValue) throws JacksonException
12621262 return getLongValue ();
12631263 }
12641264 if (t == JsonToken .START_ARRAY ) {
1265- _streamReadContext = _streamReadContext . createChildArrayContext (_tokenInputRow , _tokenInputCol );
1265+ createChildArrayContext (_tokenInputRow , _tokenInputCol );
12661266 } else if (t == JsonToken .START_OBJECT ) {
1267- _streamReadContext = _streamReadContext . createChildObjectContext (_tokenInputRow , _tokenInputCol );
1267+ createChildObjectContext (_tokenInputRow , _tokenInputCol );
12681268 }
12691269 return defaultValue ;
12701270 }
Original file line number Diff line number Diff line change @@ -686,10 +686,10 @@ private final JsonToken _nextTokenNotInObject(int i) throws IOException
686686 }
687687 switch (i ) {
688688 case '[' :
689- _streamReadContext = _streamReadContext . createChildArrayContext (_tokenInputRow , _tokenInputCol );
689+ createChildArrayContext (_tokenInputRow , _tokenInputCol );
690690 return _updateToken (JsonToken .START_ARRAY );
691691 case '{' :
692- _streamReadContext = _streamReadContext . createChildObjectContext (_tokenInputRow , _tokenInputCol );
692+ createChildObjectContext (_tokenInputRow , _tokenInputCol );
693693 return _updateToken (JsonToken .START_OBJECT );
694694 case 't' :
695695 _matchToken ("true" , 1 );
Original file line number Diff line number Diff line change 88import tools .jackson .core .*;
99import tools .jackson .core .exc .StreamConstraintsException ;
1010import tools .jackson .core .json .JsonFactory ;
11- import tools .jackson .core .unittest .testutil .failure .JacksonTestFailureExpected ;
1211
1312import static org .junit .jupiter .api .Assertions .*;
1413
1514/**
1615 * Nesting Depth Constraint Bypass in UTF8DataInputJsonParser
1716 */
18- class DeeplyNestedContentViaDataInputTest {
19-
17+ class DeeplyNestedContentViaDataInputTest
18+ {
2019 private static final int TEST_NESTING_DEPTH = 5000 ;
2120
2221 private final JsonFactory factory = new JsonFactory ();
2322
24- // 19-Feb-2026, tatu: Regression; works in 2.x
25- @ JacksonTestFailureExpected
23+ // [core#1553] Regression; works in 2.x
2624 @ Test
2725 void dataInputParserBypassesNestingDepth () throws Exception {
2826 byte [] data = buildNestedArrays (TEST_NESTING_DEPTH );
2927 DataInput di = new DataInputStream (new ByteArrayInputStream (data ));
30-
3128 int maxDepth = 0 ;
3229 try (JsonParser p = factory .createParser (ObjectReadContext .empty (), di )) {
3330 while (p .nextToken () != null ) {
You can’t perform that action at this time.
0 commit comments