1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-25 08:58:14 +00:00

fix(crypto): fix required output length in xmr_base58_encode()

This commit is contained in:
Ondřej Vejpustek 2022-07-11 17:54:28 +02:00 committed by Andrew Kozlik
parent 7a5cfbae19
commit e0358c7f24

View File

@ -151,7 +151,7 @@ bool xmr_base58_encode(char *b58, size_t *b58sz, const void *data, size_t binsz)
size_t res_size = full_block_count * full_encoded_block_size + encoded_block_sizes[last_block_size]; size_t res_size = full_block_count * full_encoded_block_size + encoded_block_sizes[last_block_size];
if (b58sz){ if (b58sz){
if (res_size >= *b58sz){ if (res_size > *b58sz){
return false; return false;
} }
*b58sz = res_size; *b58sz = res_size;