psbt: assertion for index in bounds

This commit is contained in:
niftynei 2020-08-13 11:38:46 -05:00 committed by Rusty Russell
parent d1d96a9952
commit 973456ce23

View File

@ -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]);