mirror of
https://codeberg.org/anoncontributorxmr/monero.git
synced 2024-12-11 11:14:24 -07:00
Fix assert bug in base58 encode
The previous implementation was almost certainly a typo. full_block_size is the maximum index in the encoded_block_sizes array, and size is used as an index in this array. So now 1 <= size <= full_block_size == 8 instead of 1 <= size <= sizeof(full_block_size) == size_of(size_t) == ? (maybe 4 on 32-bit systems!)
This commit is contained in:
parent
26c83c5dea
commit
7259f07a20
@ -110,7 +110,7 @@ namespace tools
|
|||||||
|
|
||||||
void encode_block(const char* block, size_t size, char* res)
|
void encode_block(const char* block, size_t size, char* res)
|
||||||
{
|
{
|
||||||
assert(1 <= size && size <= sizeof(full_block_size));
|
assert(1 <= size && size <= full_block_size);
|
||||||
|
|
||||||
uint64_t num = uint_8be_to_64(reinterpret_cast<const uint8_t*>(block), size);
|
uint64_t num = uint_8be_to_64(reinterpret_cast<const uint8_t*>(block), size);
|
||||||
int i = static_cast<int>(encoded_block_sizes[size]) - 1;
|
int i = static_cast<int>(encoded_block_sizes[size]) - 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user