Skip to content

Commit

Permalink
buffer overflow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
diogorac committed Oct 30, 2018
1 parent d7d87fa commit 1caa041
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trezor-crypto/segwit_addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int bech32_decode(char* hrp, uint8_t *data, size_t *data_len, const char *input)
++(*data_len);
}
hrp_len = input_len - (1 + *data_len);
if (hrp_len < 1 || *data_len < 6) {
if (1 + *data_len >= input_len || *data_len < 6) {
return 0;
}
*(data_len) -= 6;
Expand Down

0 comments on commit 1caa041

Please sign in to comment.