mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
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:
commit
c9c21cf7df
1 changed files with 8 additions and 4 deletions
12
src/psbt.h
12
src/psbt.h
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue