cess icon indicating copy to clipboard operation
cess copied to clipboard

SBP: Potential overflow issues

Open NachoPal opened this issue 2 years ago • 2 comments

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.

NachoPal avatar May 23 '22 05:05 NachoPal

thank you for your advice, w'll look into it. cc @shakawwq

swowk avatar May 26 '22 06:05 swowk

The modification has been completed in commit https://github.com/CESSProject/cess/commit/6fa35a7f04806907084465401dc705ce5e616a1b. Thank you.

shakawwq avatar May 31 '22 01:05 shakawwq