crypto_data_hkdf/4: do not crash for length > usize::max_value()
For now, we fail silently in such cases. Noted by @notoria in #533. Many thanks!
This commit is contained in:
@@ -5285,11 +5285,12 @@ impl MachineState {
|
||||
usize::try_from(n).unwrap()
|
||||
}
|
||||
Ok(Number::Integer(n)) => {
|
||||
n.to_usize().unwrap()
|
||||
}
|
||||
_ => {
|
||||
unreachable!()
|
||||
match n.to_usize() {
|
||||
Some(u) => { u }
|
||||
_ => { self.fail = true; return Ok(()); }
|
||||
}
|
||||
}
|
||||
_ => { unreachable!() }
|
||||
};
|
||||
|
||||
let ints_list =
|
||||
|
||||
Reference in New Issue
Block a user