-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
- Loading branch information
1 parent
5dd5f74
commit 28e3b69
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
yaml/src/test/java/com/fasterxml/jackson/dataformat/yaml/failing/FuzzYAMLRead50431Test.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,29 @@ | ||
package com.fasterxml.jackson.dataformat.yaml.failing; | ||
|
||
import com.fasterxml.jackson.core.exc.StreamReadException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.dataformat.yaml.ModuleTestBase; | ||
|
||
/** | ||
* Reproduction of: | ||
* | ||
* https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50431 | ||
*/ | ||
public class FuzzYAMLRead50431Test extends ModuleTestBase | ||
{ | ||
private final ObjectMapper YAML_MAPPER = newObjectMapper(); | ||
|
||
// https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=50431 | ||
public void testUnicodeDecoding50431() throws Exception | ||
{ | ||
String input = "\n\"\\UE30EEE"; | ||
try { | ||
YAML_MAPPER.readTree(input); | ||
fail("Should not pass"); | ||
} catch (StreamReadException e) { | ||
// Not sure what to verify, but should be exposed as one of Jackson's | ||
// exceptions (or possibly IOException) | ||
verifyException(e, "Not a valid Unicode code point: 0xE30EEE"); | ||
} | ||
} | ||
} |