Skip to content

Commit

Permalink
Merge #149: Fix potential buffer overflow in Bech32
Browse files Browse the repository at this point in the history
eeed835 Fix potential buffer overflow in Bech32 Reported by Christian Reitter and Dr. Jochen Hoenicke (Jonas Schnelli)

Pull request description:

  Reported by Christian Reitter and Dr. Jochen Hoenicke

Tree-SHA512: b8050a84f04f7f23a7889ce73d9c9d71b1406e34333a2d869a5c3b20f99a71ddf898e70094fd96d8ab4ed6e682d1aae394088e39f8fd0278e282caf5c2398a46
  • Loading branch information
jonasschnelli committed Nov 4, 2018
2 parents 1a33fa2 + eeed835 commit 53064bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/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 53064bd

Please sign in to comment.