Skip to content

Commit 321bbc2

Browse files
committed
fix ubsan: bitcoin-tx: not initialize context before IsFullyValid
1 parent f34cdcb commit 321bbc2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bitcoin-tx.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -651,11 +651,13 @@ static void MutateTx(CMutableTransaction& tx, const std::string& command,
651651
MutateTxDelOutput(tx, commandVal);
652652
else if (command == "outaddr")
653653
MutateTxAddOutAddr(tx, commandVal);
654-
else if (command == "outpubkey")
654+
else if (command == "outpubkey") {
655+
if (!ecc) { ecc.reset(new Secp256k1Init()); }
655656
MutateTxAddOutPubKey(tx, commandVal);
656-
else if (command == "outmultisig")
657+
} else if (command == "outmultisig") {
658+
if (!ecc) { ecc.reset(new Secp256k1Init()); }
657659
MutateTxAddOutMultiSig(tx, commandVal);
658-
else if (command == "outscript")
660+
} else if (command == "outscript")
659661
MutateTxAddOutScript(tx, commandVal);
660662
else if (command == "outdata")
661663
MutateTxAddOutData(tx, commandVal);

0 commit comments

Comments
 (0)