Closed cowtowncoder closed 3 years ago
One change for more robust handling: allow zero-length payload for BigInteger
(value, or unscaled part) to represent BigInteger.ZERO
and BigDecimal.ZERO
respectively. Since rules regarding this particular potential encoding were not spelled out, seems safest to do this instead of exception.
(note: offshoot of this finding https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=32168)
Looks like following 7-byte document encoding a single "BigInteger" value:
causes an exception within
BigInteger
, attempting to pass 0-byte array to constructBigInteger
(to further createBigDecimal
). That is not a valid value and needs to be specifically checked against, reported.