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 Dec 16, 2020
1 parent 5c8273c commit b9ee1a6
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 @@ -498,11 +498,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 b9ee1a6

Please sign in to comment.