Fix duration overflow, expiry-warned resets, DICT control-char injection, and HostServ TAKE forbid recheck
This commit is contained in:
parent
68df1e7078
commit
d833dc28f0
5 changed files with 20 additions and 2 deletions
|
|
@ -2354,7 +2354,9 @@ pub fn parse_duration(s: &str) -> Option<u64> {
|
|||
c if c.is_ascii_digit() => (s, 1),
|
||||
_ => return None,
|
||||
};
|
||||
num.parse::<u64>().ok().map(|n| n * mult)
|
||||
// Checked so an out-of-range duration is rejected (None) rather than wrapping to
|
||||
// a garbage/near-instant expiry in a release build.
|
||||
num.parse::<u64>().ok().and_then(|n| n.checked_mul(mult))
|
||||
}
|
||||
|
||||
// Case-insensitive hostmask glob: `*` (any run) and `?` (one char).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue