Skip to content

Commit 15ed91c

Browse files
committed
Add one more fuzz test wrt UTF-32 decoding (wrt woodstox-core/125 issue)
1 parent 5bceeb2 commit 15ed91c

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.fasterxml.jackson.dataformat.xml.fuzz;
2+
3+
import com.fasterxml.jackson.core.exc.StreamReadException;
4+
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
5+
import com.fasterxml.jackson.dataformat.xml.XmlTestBase;
6+
7+
// [dataformat-xml#???]
8+
// (but root cause of https://github.com/FasterXML/woodstox/issues/125)
9+
//
10+
// NOTE! Not reproducible for some reason with these settings (probably
11+
// has different buffer sizes or... something
12+
public class FuzzXXX_32969_UTF32Test extends XmlTestBase
13+
{
14+
private final XmlMapper MAPPER = newMapper();
15+
16+
public void testUTF32() throws Exception
17+
{
18+
final byte[] doc = readResource("/data/fuzz-32906.xml");
19+
try {
20+
MAPPER.readTree(doc, 0, doc.length);
21+
fail("Should not pass");
22+
} catch (StreamReadException e) {
23+
verifyException(e, "Unexpected EOF in CDATA");
24+
} catch (RuntimeException e) {
25+
fail("Should fail with specific `StreamReadException` but got: "+e);
26+
}
27+
}
28+
}
15.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)