Skip to content

Commit

Permalink
Add failing test for #400 (yaml, char decoding) (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder authored Mar 8, 2023
1 parent 5dd5f74 commit 28e3b69
Showing 1 changed file with 29 additions and 0 deletions.
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");
}
}
}

0 comments on commit 28e3b69

Please sign in to comment.