-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for #420: Wrap unexpected IOOBE
Signed-off-by: Arthur Chan <[email protected]>
- Loading branch information
1 parent
207adca
commit 82b2ce3
Showing
3 changed files
with
67 additions
and
12 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
33 changes: 33 additions & 0 deletions
33
ion/src/test/java/com/fasterxml/jackson/dataformat/ion/fuzz/Fuzz417_64721InvalidIonTest.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,33 @@ | ||
package com.fasterxml.jackson.dataformat.ion.fuzz; | ||
|
||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.junit.Assert.fail; | ||
|
||
import org.hamcrest.Matchers; | ||
import org.junit.Test; | ||
|
||
import com.fasterxml.jackson.core.exc.StreamReadException; | ||
import com.fasterxml.jackson.dataformat.ion.*; | ||
|
||
// [dataformats-binary#417] | ||
public class Fuzz417_64721InvalidIonTest | ||
{ | ||
enum EnumFuzz { | ||
A, B, C, D, E; | ||
} | ||
|
||
@Test | ||
public void testFuzz64721AssertionException() throws Exception { | ||
IonFactory f = IonFactory | ||
.builderForBinaryWriters() | ||
.enable(IonParser.Feature.USE_NATIVE_TYPE_ID) | ||
.build(); | ||
IonObjectMapper mapper = IonObjectMapper.builder(f).build(); | ||
try { | ||
mapper.readValue("$0/", EnumFuzz.class); | ||
fail("Should not pass (invalid content)"); | ||
} catch (StreamReadException e) { | ||
assertThat(e.getMessage(), Matchers.containsString("Internal `IonReader` error")); | ||
} | ||
} | ||
} |