GEO-network-client icon indicating copy to clipboard operation
GEO-network-client copied to clipboard

[Long Arithmetic] Potential overflow of TrustLineBalance

Open HaySayCheese opened this issue 6 years ago • 0 comments

TrustLineBalance is now defined as boost::multiprecision::uint256 (fixed precision). In case of operation (2**256 -1) + (2**256 -1) this type overflows. We should consider fixing this in one of 2 ways possible:

  • Increase balance to 2**257
  • or perform all math operations with strong checks for overflow occured.

HaySayCheese avatar Mar 14 '19 07:03 HaySayCheese