crypto_password_hash/3: fail if the number of iterations is too high

Discussed in #527.
This commit is contained in:
Markus Triska
2020-05-18 13:11:39 +02:00
parent e9f8b35918
commit fac7ba70c8

View File

@@ -5285,7 +5285,10 @@ impl MachineState {
u64::try_from(n).unwrap()
}
Ok(Number::Integer(n)) => {
n.to_u64().unwrap()
match n.to_u64() {
Some(i) => { i }
None => { self.fail = true; return Ok(()); }
}
}
_ => {
unreachable!()