1
0
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:
Pavol Rusnak 2018-10-23 18:01:44 +02:00
parent a938a1c901
commit eacfa751f9
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -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;