pow: Fix off-by-one error
Length check has an off-by-one error in it, we want the check it include hex strings of length 32 (eg, 128 bytes).
This commit is contained in:
parent
4ce7ee179a
commit
47e4bff0ee
|
@ -497,7 +497,7 @@ impl U256 {
|
|||
|
||||
// Caller to ensure `s` does not contain a prefix.
|
||||
fn from_hex_internal(s: &str) -> Result<Self, ParseIntError> {
|
||||
let (high, low) = if s.len() < 32 {
|
||||
let (high, low) = if s.len() <= 32 {
|
||||
let low = parse::hex_u128_unchecked(s)?;
|
||||
(0, low)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue