Skip to content
Snippets Groups Projects
Unverified Commit 3f5edc52 authored by Keith Yeung's avatar Keith Yeung Committed by GitHub
Browse files

Use safe math when pruning statuses (#1835)


Co-authored-by: default avatarFrancisco Aguirre <franciscoaguirreperez@gmail.com>
parent 55f35442
Branches
No related merge requests found
Pipeline #399388 failed with stages
in 57 minutes and 27 seconds
......@@ -1129,7 +1129,7 @@ impl<T: Config> XcmpMessageSource for Pallet<T> {
let pruned = old_statuses_len - statuses.len();
// removing an item from status implies a message being sent, so the result messages must
// be no less than the pruned channels.
statuses.rotate_left(result.len() - pruned);
statuses.rotate_left(result.len().saturating_sub(pruned));
<OutboundXcmpStatus<T>>::put(statuses);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment