You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Bound checking BigDecimal in Timestamp to guard against DoS
Operations that require inflating the BigDecimal can be expensive for
large exponents, examples:
* longValue
* intValue
* setScale
#159
calling
longValue()
on large exponentBigDecimal
s, e.g.1e100000000
and1e-100000000
, is very expensive, each took ~2 minutes on my machine.A solution is to check bounds and removing the fractional component before calling
longValue()
Affected code:
https://github.com/amzn/ion-java/blob/master/src/software/amazon/ion/Timestamp.java#L689-L707
That's the only occurrence of
BigDecimal#longValue
I found inion-java
Jackson is dealing with a similar issue: FasterXML/jackson-databind#2141
The text was updated successfully, but these errors were encountered: