Skip to content

Commit

Permalink
Bump jackson from 2.14.2 to 2.15.0 (#3857) (#3866)
Browse files Browse the repository at this point in the history
(cherry picked from commit 418ec4e)
  • Loading branch information
pengxiangrui127 authored Jul 24, 2023
1 parent 6712e96 commit da4ed14
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
import java.io.InputStream;
import java.util.Date;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.exc.StreamConstraintsException;
import com.google.common.base.Strings;
import org.apache.servicecomb.foundation.common.utils.RestObjectMapper;
import org.junit.jupiter.api.Assertions;

Expand Down Expand Up @@ -90,4 +93,18 @@ public void testJsonObjectWork() {
Assertions.fail();
}
}

@Test
public void testReadValue() {
String content = "{\"desc\":" + Strings.repeat("9", 1001) + "}";
try {
RestObjectMapperFactory.getRestObjectMapper().readValue(content, PojoModel.class);
Assertions.fail();
} catch (StreamConstraintsException e) {
// right place, nothing to do.
} catch (JsonProcessingException ex) {
Assertions.fail();
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
public class TestDoSFix {
static final ObjectMapper mapper = new RestObjectMapper();

static final String invalidNum = Strings.repeat("9", 100_0000);
static final String invalidNum = Strings.repeat("9", 1000);

static final String invalidStr = "\"" + invalidNum + "\"";

Expand Down
2 changes: 1 addition & 1 deletion dependencies/default/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<hibernate-validator.version>6.2.5.Final</hibernate-validator.version>
<httpcomponents.version>4.5.14</httpcomponents.version>
<hystrix.version>1.5.18</hystrix.version>
<jackson.version>2.14.2</jackson.version>
<jackson.version>2.15.0</jackson.version>
<java-websocket.version>1.5.3</java-websocket.version>
<javax-annotation.version>1.3.2</javax-annotation.version>
<javax-inject.version>1</javax-inject.version>
Expand Down

0 comments on commit da4ed14

Please sign in to comment.