mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
bech32: fix overflow bug.
Copied from upstream:
2b0aac650c
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
1935614979
commit
a1898b699d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user