From 973456ce23b7418a3f03998e317939c5af3e6f01 Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 13 Aug 2020 11:38:46 -0500 Subject: [PATCH] psbt: assertion for index in bounds --- common/psbt_open.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/psbt_open.c b/common/psbt_open.c index 2061a1796..70a027b8f 100644 --- a/common/psbt_open.c +++ b/common/psbt_open.c @@ -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]);