go-money icon indicating copy to clipboard operation
go-money copied to clipboard

Fix Integer Overflow in Allocate Function

Open pendolf opened this issue 9 months ago • 0 comments

This PR addresses an integer overflow issue in the Allocate function. When the sum of given ratios exceeds the maximum value for an int64, it results in a negative value, causing runtime errors. This fix includes:

  • Updating the Allocate function to check for potential overflows.
  • Adding a new test case to ensure the error is correctly handled.

Related Issues

  • Fixes #136

pendolf avatar May 25 '24 19:05 pendolf