mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge bitcoin/bitcoin#34272: psbt: Fix PSBTInputSignedAndVerified bounds assert
2f5b1c5f80psbt: Fix `PSBTInputSignedAndVerified` bounds `assert` (Lőrinc) Pull request description: This PR fixes an off-by-one in a debug assertion in `PSBTInputSignedAndVerified`. The function indexes `psbt.inputs[input_index]`, so the assertion must not allow indexing at `psbt.inputs.size()`. Found during review: https://github.com/bitcoin/bitcoin/pull/31650#discussion_r2685892867 ACKs for top commit: optout21: utACK2f5b1c5f80maflcko: lgtm ACK2f5b1c5f80achow101: ACK2f5b1c5f80Tree-SHA512: cec613a9a38358d5caa243197d746baa129aebfd7fe697689f28e652f94c4683873c4676d5eb2eb909ea19de5e5f6e54ecc5f3162384a48f6f38a59273667689
This commit is contained in:
@@ -325,7 +325,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) {
|
||||
|
||||
Reference in New Issue
Block a user