Skip to content

Commit

Permalink
Merge branch '2.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Jan 15, 2024
2 parents b65f3ea + 937b637 commit f48f23a
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions ion/src/main/java/tools/jackson/dataformat/ion/IonParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ private double _getDoubleValue() throws JacksonException {
return _reportCorruptNumber(e);
}
}

@Override
public float getFloatValue() throws JacksonException {
_verifyIsNumberToken();
Expand All @@ -364,7 +365,17 @@ public int getIntValue() throws JacksonException {
@Override
public long getLongValue() throws JacksonException {
_verifyIsNumberToken();
return _reader.longValue();
return _getLongValue();
}

private long _getLongValue() throws JacksonException {
try {
return _reader.longValue();
} catch (IonException
// 14-Jan-2024, tatu: OSS-Fuzz#65731 points to AIOOBE:
| ArrayIndexOutOfBoundsException e) {
return _reportCorruptNumber(e);
}
}

// @since 2.17
Expand Down Expand Up @@ -454,11 +465,11 @@ public Number getNumberValue() throws JacksonException {
case INT:
return _reader.intValue();
case LONG:
return _reader.longValue();
return _getLongValue();
case FLOAT:
return (float) _reader.doubleValue();
return (float) _getDoubleValue();
case DOUBLE:
return _reader.doubleValue();
return _getDoubleValue();
case BIG_DECIMAL:
return _getBigDecimalValue();
case BIG_INTEGER:
Expand Down

0 comments on commit f48f23a

Please sign in to comment.