Skip to content

Commit

Permalink
fix invalid memory access that I added when merging descriptor wallets
Browse files Browse the repository at this point in the history
Thanks, ubsan + fuzzer!
  • Loading branch information
apoelstra committed Mar 26, 2021
1 parent 98d0ff7 commit fec99ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/script/sign.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@ bool SignTransaction(CMutableTransaction& mtx, const SigningProvider* keystore,
prevTxOut = GetPeginOutputFromWitness(mtx.witness.vtxinwit[i].m_pegin_witness);
} else {
auto coin = coins.find(txin.prevout);
prevTxOut = coin->second.out;
if (coin == coins.end() || coin->second.IsSpent()) {
input_errors[i] = "Input not found or already spent";
continue;
}
prevTxOut = coin->second.out;
}

const CScript& prevPubKey = prevTxOut.scriptPubKey;
Expand Down

0 comments on commit fec99ef

Please sign in to comment.