mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-19 19:12:03 +00:00
fix(crypto): set output length correctly in xmr_base58_encode()
This commit is contained in:
parent
81c9cd66ef
commit
7a5cfbae19
@ -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)
|
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;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const char * data_bin = data;
|
const char * data_bin = data;
|
||||||
size_t full_block_count = binsz / full_block_size;
|
size_t full_block_count = binsz / full_block_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user