Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pset: fix NULL pointer dereference when deserializing malformed PSETs over RPC #1416

Merged
merged 2 commits into from
Feb 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/psbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand Down