Skip to content

Commit bb75f04

Browse files
committed
Merge branch '2.7.x'
Closes spring-projectsgh-32032
2 parents 1efad88 + 9e1a69e commit bb75f04

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/json/BasicJsonParser.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private Object parseInternal(int nesting, String json) {
6767
return parseListInternal(nesting + 1, json);
6868
}
6969
if (json.startsWith("{")) {
70-
return parseMapInternal(nesting, json);
70+
return parseMapInternal(nesting + 1, json);
7171
}
7272
if (json.startsWith("\"")) {
7373
return trimTrailingCharacter(trimLeadingCharacter(json, '"'), '"');

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/AbstractJsonParserTests.java

+8
Original file line numberDiff line numberDiff line change
@@ -205,4 +205,12 @@ void largeMalformed() throws IOException {
205205
assertThatExceptionOfType(JsonParseException.class).isThrownBy(() -> this.parser.parseList(input));
206206
}
207207

208+
@Test // gh-32029
209+
void deeplyNestedMap() throws IOException {
210+
String input = StreamUtils.copyToString(
211+
AbstractJsonParserTests.class.getResourceAsStream("deeply-nested-map-json.txt"),
212+
StandardCharsets.UTF_8);
213+
assertThatExceptionOfType(JsonParseException.class).isThrownBy(() -> this.parser.parseList(input));
214+
}
215+
208216
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��{":{":{":{":{":{":[{":{"":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{":{"��

0 commit comments

Comments
 (0)