File tree Expand file tree Collapse file tree
main/java/com/fasterxml/jackson/dataformat/ion
test/java/com/fasterxml/jackson/dataformat/ion/fuzz Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -397,7 +397,18 @@ public float getFloatValue() throws IOException {
397397 @ Override
398398 public int getIntValue () throws IOException {
399399 _verifyIsNumberToken ();
400- return _reader .intValue ();
400+ return _getIntValue ();
401+ }
402+
403+ // @since 2.17
404+ private int _getIntValue () throws IOException {
405+ try {
406+ return _reader .intValue ();
407+ } catch (IonException
408+ // 15-Jan-2024, tatu: other OSS-Fuzz tests suggest we need this:
409+ | ArrayIndexOutOfBoundsException e ) {
410+ return _reportCorruptNumber (e );
411+ }
401412 }
402413
403414 @ Override
@@ -453,8 +464,8 @@ public NumberType getNumberType() throws IOException
453464 size = _reader .getIntegerSize ();
454465 } catch (IonException e ) {
455466 return _reportCorruptNumber (e );
456- } catch (NullPointerException e ) {
457- return _reportCorruptContent (e );
467+ } catch (AssertionError | NullPointerException e ) {
468+ return _reportCorruptNumber (e );
458469 }
459470 if (size == null ) {
460471 _reportError ("Current token (%s) not integer" , _currToken );
@@ -502,7 +513,7 @@ public Number getNumberValue() throws IOException {
502513 if (nt != null ) {
503514 switch (nt ) {
504515 case INT :
505- return _reader . intValue ();
516+ return _getIntValue ();
506517 case LONG :
507518 return _getLongValue ();
508519 case FLOAT :
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public void testFuzz65274Malformed() throws Exception {
4343 ION_MAPPER .readTree (new ByteArrayInputStream (doc ));
4444 fail ("Should not pass (invalid content)" );
4545 } catch (StreamReadException e ) {
46- assertThat (e .getMessage (), Matchers .containsString ("Corrupt content to decode" ));
46+ assertThat (e .getMessage (), Matchers .containsString ("Corrupt Number value to decode" ));
4747 }
4848 }
4949
You can’t perform that action at this time.
0 commit comments