Skip to content
Permalink
Browse files

bech32: fix overflow bug.

Copied from upstream:

 sipa/bech32@2b0aac6

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Oct 31, 2018
1 parent 1935614 commit a1898b699d4664ec0326dcd5f7b505ab8fa4983d
Showing with 1 addition and 1 deletion.
  1. +1 −1 common/bech32.c
@@ -99,7 +99,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;

0 comments on commit a1898b6

Please sign in to comment.
You can’t perform that action at this time.