diff --git a/src/util/base58.rs b/src/util/base58.rs index 394b38fa..68a0a2b7 100644 --- a/src/util/base58.rs +++ b/src/util/base58.rs @@ -131,7 +131,7 @@ pub fn from(data: &str) -> Result, Error> { // Build in base 256 for d58 in data.bytes() { // Compute "X = X * 58 + next_digit" in base 256 - if d58 as usize > BASE58_DIGITS.len() { + if d58 as usize >= BASE58_DIGITS.len() { return Err(Error::BadByte(d58)); } let mut carry = match BASE58_DIGITS[d58 as usize] {