-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…139)
- Loading branch information
1 parent
3b95db3
commit 8854403
Showing
4 changed files
with
43 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
guava/src/test/java/com/fasterxml/jackson/datatype/guava/fuzz/Fuzz138_65117Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.fasterxml.jackson.datatype.guava.fuzz; | ||
|
||
import org.junit.Assert; | ||
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.exc.MismatchedInputException; | ||
import com.fasterxml.jackson.datatype.guava.ModuleTestBase; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
|
||
/** | ||
* Unit tests for verifying the fixes for OSS-Fuzz issues | ||
* work as expected | ||
* (see [datatypes-collections#138]). | ||
*/ | ||
public class Fuzz138_65117Test extends ModuleTestBase | ||
{ | ||
private final ObjectMapper MAPPER = mapperWithModule(); | ||
|
||
public void testOSSFuzzIssue65117() throws Exception | ||
{ | ||
final TypeReference<?> ref = new TypeReference<ImmutableList<Integer>>() {}; | ||
MismatchedInputException e = Assert.assertThrows( | ||
MismatchedInputException.class, | ||
() -> MAPPER.readValue("[\"\"s(", ref)); | ||
verifyException(e, "Guava `Collection` of type "); | ||
verifyException(e, "does not accept `null` values"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters