Skip to content

Commit

Permalink
psbt: assertion for index in bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
niftynei authored and rustyrussell committed Aug 18, 2020
1 parent d1d96a9 commit 973456c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions common/psbt_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ bool psbt_has_required_fields(struct wally_psbt *psbt)
return false;

/* If is P2SH, redeemscript must be present */
assert(psbt->tx->inputs[i].index < input->utxo->num_outputs);
const u8 *outscript =
wally_tx_output_get_script(tmpctx,
&input->utxo->outputs[psbt->tx->inputs[i].index]);
Expand Down

0 comments on commit 973456c

Please sign in to comment.