mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-31 10:41:08 +00:00
psbt: Fix PSBTInputSignedAndVerified bounds assert
The previous `assert` used `>=`, allowing `input_index == psbt.inputs.size()` and out-of-bounds access in `psbt.inputs[input_index]`. Found during review: https://github.com/bitcoin/bitcoin/pull/31650#discussion_r2685892867 Github-Pull: #34272 Rebased-From: 2f5b1c5f80590ffa6b5a5bcfb21fddb1dc22e852
This commit is contained in:
parent
22bd00651a
commit
7e1090f5e8
@ -301,7 +301,7 @@ bool PSBTInputSigned(const PSBTInput& input)
|
||||
bool PSBTInputSignedAndVerified(const PartiallySignedTransaction psbt, unsigned int input_index, const PrecomputedTransactionData* txdata)
|
||||
{
|
||||
CTxOut utxo;
|
||||
assert(psbt.inputs.size() >= input_index);
|
||||
assert(input_index < psbt.inputs.size());
|
||||
const PSBTInput& input = psbt.inputs[input_index];
|
||||
|
||||
if (input.non_witness_utxo) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user