mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-02 03:31:09 +00:00
wallet: Check utxo prevout index out of bounds in sendall
Github-Pull: #26344 Rebased-From: b132c85650afb2182f2e58e903f3d6f86fd3fb22
This commit is contained in:
parent
931db785ee
commit
dedee6af57
@ -1380,7 +1380,7 @@ RPCHelpMan sendall()
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Input not available. UTXO (%s:%d) was already spent.", input.prevout.hash.ToString(), input.prevout.n));
|
||||
}
|
||||
const CWalletTx* tx{pwallet->GetWalletTx(input.prevout.hash)};
|
||||
if (!tx || !(pwallet->IsMine(tx->tx->vout[input.prevout.n]) & (coin_control.fAllowWatchOnly ? ISMINE_ALL : ISMINE_SPENDABLE))) {
|
||||
if (!tx || input.prevout.n >= tx->tx->vout.size() || !(pwallet->IsMine(tx->tx->vout[input.prevout.n]) & (coin_control.fAllowWatchOnly ? ISMINE_ALL : ISMINE_SPENDABLE))) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Input not found. UTXO (%s:%d) is not part of wallet.", input.prevout.hash.ToString(), input.prevout.n));
|
||||
}
|
||||
total_input_value += tx->tx->vout[input.prevout.n].nValue;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user