From 91dd21b561b7f9a0a0d34fc694bd739e80dbe6f1 Mon Sep 17 00:00:00 2001 From: Christian Reitter Date: Sat, 27 Nov 2021 13:32:41 +0100 Subject: [PATCH] fix(crypto): clarify incorrect base58.c code comment --- crypto/monero/base58.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto/monero/base58.c b/crypto/monero/base58.c index 689595676..7d875cac2 100644 --- a/crypto/monero/base58.c +++ b/crypto/monero/base58.c @@ -119,7 +119,11 @@ bool decode_block(const char* block, size_t size, char* res) return false; // Overflow res_num = tmp; - order *= alphabet_size; // Never overflows, 58^10 < 2^64 + // The original code comment for the order multiplication says + // "Never overflows, 58^10 < 2^64" + // This is incorrect since it overflows on the 11th iteration + // However, there is no negative impact since the result is unused + order *= alphabet_size; } if ((size_t)res_size < full_block_size && (UINT64_C(1) << (8 * res_size)) <= res_num)