Merge pull request #1416 from apoelstra/2025-02--psbt-fix

pset: fix NULL pointer dereference when deserializing malformed PSETs over RPC
This commit is contained in:
Byron Hambly 2025-02-18 15:06:38 +02:00 committed by GitHub
commit c9c21cf7df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -901,12 +901,16 @@ struct PSBTInput
Sidechain::Bitcoin::CTransactionRef tx;
OverrideStream<Stream> os(&s, s.GetType(), s.GetVersion());
UnserializeFromVector(os, tx);
m_peg_in_tx = tx;
if (tx) {
m_peg_in_tx = tx;
}
} else {
CTransactionRef tx;
OverrideStream<Stream> os(&s, s.GetType(), s.GetVersion());
UnserializeFromVector(os, tx);
m_peg_in_tx = tx;
if (tx) {
m_peg_in_tx = tx;
}
}
break;
}
@ -1091,9 +1095,9 @@ struct PSBTInput
} else if (subkey_len != 1) {
throw std::ios_base::failure("Input issuance needs blinded flag is more than one byte type");
}
bool b;
uint8_t b;
UnserializeFromVector(s, b);
m_blinded_issuance = b;
m_blinded_issuance = !!b;
break;
}
default: