cess
cess copied to clipboard
SBP: Potential overflow issues
Review potential overflow situations where operators +
, -
, *
and /
are used.
E.g:https://github.com/CESSProject/cess/blob/main/c-pallets/file-bank/src/lib.rs#L550
If operations are safe it is a good practice to add a comment about why.
Use checked_add
, checked_sub
, checked_mul
, checked_div
, instead.
thank you for your advice, w'll look into it. cc @shakawwq
The modification has been completed in commit https://github.com/CESSProject/cess/commit/6fa35a7f04806907084465401dc705ce5e616a1b. Thank you.