Division by 0 totalWeights #205
Labels
1 (Low Risk)
Assets are not at risk. State handling, function incorrect as to spec, issues with comments
bug
Something isn't working
duplicate
This issue or pull request already exists
Handle
pauliax
Vulnerability details
Impact
totalWeights might be zero and this will cause division by 0 runtime error. function _computeShareCount divides by _totalWeights:
Admin can accidentaly set totalWeights to 0 in function setRoyaltiesWeight when totalWeights = royaltiesWeight and _weight = 0.
Recommended Mitigation Steps
Consider algorithmitcally enforcing totalWeights > 0 or handle this special case in function _computeShareCount.
The text was updated successfully, but these errors were encountered: