diff --git a/util/bigint/src/uint.rs b/util/bigint/src/uint.rs index 0336e8c7f..be9941589 100644 --- a/util/bigint/src/uint.rs +++ b/util/bigint/src/uint.rs @@ -797,7 +797,7 @@ macro_rules! construct_uint { fn visit_str(&mut self, value: &str) -> Result where E: serde::Error { // 0x + len - if value.len() > 2 + $n_words * 16 { + if value.len() > 2 + $n_words * 16 || value.len() < 2 { return Err(serde::Error::custom("Invalid length.")); }