1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-21 23:18:13 +00:00

fix(crypto): set output length correctly in xmr_base58_encode()

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

View File

@ -138,8 +138,12 @@ bool decode_block(const char* block, size_t size, char* res)
bool xmr_base58_encode(char *b58, size_t *b58sz, const void *data, size_t binsz)
{
if (binsz==0)
if (binsz==0) {
if (b58sz) {
*b58sz = 0;
}
return true;
}
const char * data_bin = data;
size_t full_block_count = binsz / full_block_size;