[vault] Standing approvals: a rule's use count saturates instead of overflowing (a stored count at its end made the next standing signature panic in debug builds); v0.16.1

This commit is contained in:
2026-11-11 16:19:35 +01:00
parent 95613f4ed0
commit 2c2d56b856
4 changed files with 39 additions and 14 deletions
+1 -1
View File
@@ -865,7 +865,7 @@ impl Vault {
if let (Approval::Standing, Some(id)) = (approval, rule)
&& let Some(r) = self.signing.standing.iter_mut().find(|r| r.id == id)
{
r.uses += 1;
r.uses = r.uses.saturating_add(1);
r.last_used = Some(now);
}
Ok(Signed { bytes, sha256 })