FasterXML / jackson-dataformats-binary

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

(cbor) Handle case of `BigDecimal` with `Integer.MIN_VALUE` for scale gracefully #264

Closed cowtowncoder closed 3 years ago

cowtowncoder commented 3 years ago

(note: this issue https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32381 from oss-fuzz)

Looks like attempts to normalize BigDecimal using method stripTrailingZeros() fails on a specific case of BigDecimal value with smallest possible scale value, probably since Integer.MIN_VALUE does not have matching opposite positive value. This issue will need to be fixed in jackson-databind, but filing here since it is most easily exposed via binary codecs (not sure how to trigger textual version).

cowtowncoder commented 3 years ago

Fixed: actual fix in jackson-databind but regression test under cbor repo (since I could not figure out how to trigger via textual representation).