Skip to content
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

Bump jackson from 2.14.2 to 2.15.0 #3866

Merged
merged 1 commit into from
Jul 24, 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
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
Loading