mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
base58: bail out when output buffer is empty
This commit is contained in:
parent
a938a1c901
commit
eacfa751f9
5
base58.c
5
base58.c
@ -44,6 +44,11 @@ const int8_t b58digits_map[] = {
|
||||
bool b58tobin(void *bin, size_t *binszp, const char *b58)
|
||||
{
|
||||
size_t binsz = *binszp;
|
||||
|
||||
if (binsz == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const unsigned char *b58u = (const unsigned char*)b58;
|
||||
unsigned char *binu = bin;
|
||||
size_t outisz = (binsz + 3) / 4;
|
||||
|
Loading…
Reference in New Issue
Block a user