FasterXML / jackson-dataformats-binary

Uber-project for standard Jackson binary format backends: avro, cbor, ion, protobuf, smile
Apache License 2.0
310 stars 133 forks source link

`IonParser.getIntValue()` fails or does not handle value overflow checks #428

Closed cowtowncoder closed 7 months ago

cowtowncoder commented 9 months ago

(note: found via https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65180)

Looks like overflow checks not being by IonParser can result in one of outcomes:

Instead, this should be surfaced same as equivalent JsonParseException JSON-backed JsonParser throws in similar situation -- see ParserBase.convertNumberToInt() (and ParserBase.reportOverflowInt()) for examples of handling.

Same probably affects long overflow as well (wrt BigInteger range value)

cowtowncoder commented 9 months ago

Since I do not have time to work on adding coercion checks quite yet, will just add failing tests for future work. Should be relatively straight-forward for someone to pick up.