File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
main/java/com/fasterxml/jackson/dataformat/ion
test/java/com/fasterxml/jackson/dataformat/ion/fuzz Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -274,8 +274,11 @@ public String getText() throws IOException
274
274
try {
275
275
// stringValue() will throw an UnknownSymbolException if we're
276
276
// trying to get the text for a symbol id that cannot be resolved.
277
+ // stringValue() has an assert statement which could throw an
278
+ // AssertionError if we're trying to get the text with a symbol
279
+ // id less than or equals to 0.
277
280
return _reader .stringValue ();
278
- } catch (UnknownSymbolException e ) {
281
+ } catch (UnknownSymbolException | AssertionError e ) {
279
282
throw _constructError (e .getMessage (), e );
280
283
}
281
284
case VALUE_NUMBER_INT :
Original file line number Diff line number Diff line change
1
+ package com .fasterxml .jackson .dataformat .ion .fuzz ;
2
+
3
+ import com .fasterxml .jackson .core .JsonParseException ;
4
+ import com .fasterxml .jackson .dataformat .ion .*;
5
+
6
+ import java .io .IOException ;
7
+
8
+ import org .junit .Assert ;
9
+ import org .junit .Test ;
10
+
11
+ @ SuppressWarnings ("resource" )
12
+ public class Fuzz64721InvalidIonTest
13
+ {
14
+ @ Test (expected = JsonParseException .class )
15
+ public void testFuzz64721AssertionException () throws IOException {
16
+ IonFactory f = IonFactory
17
+ .builderForBinaryWriters ()
18
+ .enable (IonParser .Feature .USE_NATIVE_TYPE_ID )
19
+ .build ();
20
+ IonObjectMapper mapper = IonObjectMapper .builder (f ).build ();
21
+ mapper .readValue ("$0/" , EnumFuzz .class );
22
+ }
23
+
24
+ private static enum EnumFuzz {
25
+ A , B , C , D , E ;
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments