From abc70781e75a3d1bc667f115efbb769b008d3bef Mon Sep 17 00:00:00 2001 From: Elichai Turkel Date: Tue, 21 Jan 2020 13:36:53 +0200 Subject: [PATCH] Fix a logic problem in base58 (isn't a real bug) --- src/util/base58.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] {