1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 18:49:07 +00:00

cash_addr: fix hardcoded value of CHECKSUM_SIZE

This commit is contained in:
Pavol Rusnak 2018-10-25 11:57:03 +02:00
parent 5c6b472883
commit 2bbbc3e155
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -132,7 +132,7 @@ int cash_decode(char* hrp, uint8_t *data, size_t *data_len, const char *input) {
return 0;
}
chk = cashaddr_polymod_step(chk) ^ v;
if (i + 6 < input_len) {
if (i + CHECKSUM_SIZE < input_len) {
data[i - (1 + hrp_len)] = v;
}
++i;