You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.
Substrate does not have default overflow/underflow protection. In order to avoid this kind of bugs, it’s better to use safe functions like checked_add() and checked_sub(). In the current codebase math operations are mostly either incrementing (+1) or making operations with values that shouldn’t overflow/underflow logically:
chainbridge/src/lib.rs:L64
} else if self.votes_against.len() > (total - threshold) as usize {
It’s not really a big issue here, but if the threshold is bigger than the total, we’ll have underflow.
The text was updated successfully, but these errors were encountered:
Substrate does not have default overflow/underflow protection. In order to avoid this kind of bugs, it’s better to use safe functions like checked_add() and checked_sub(). In the current codebase math operations are mostly either incrementing (+1) or making operations with values that shouldn’t overflow/underflow logically:
chainbridge/src/lib.rs:L64
It’s not really a big issue here, but if the threshold is bigger than the total, we’ll have underflow.
The text was updated successfully, but these errors were encountered: