mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-19 18:39:10 +01:00
[BugFix]: Do not allow deserializing PSBT with empty PSBT_OUT_TAP_TREE
Github-Pull: #25858
Rebased-From: 0652dc53b2
This commit is contained in:
@@ -862,6 +862,9 @@ struct PSBTOutput
|
|||||||
std::vector<unsigned char> tree_v;
|
std::vector<unsigned char> tree_v;
|
||||||
s >> tree_v;
|
s >> tree_v;
|
||||||
SpanReader s_tree(s.GetType(), s.GetVersion(), tree_v);
|
SpanReader s_tree(s.GetType(), s.GetVersion(), tree_v);
|
||||||
|
if (s_tree.empty()) {
|
||||||
|
throw std::ios_base::failure("Output Taproot tree must not be empty");
|
||||||
|
}
|
||||||
while (!s_tree.empty()) {
|
while (!s_tree.empty()) {
|
||||||
uint8_t depth;
|
uint8_t depth;
|
||||||
uint8_t leaf_ver;
|
uint8_t leaf_ver;
|
||||||
|
|||||||
Reference in New Issue
Block a user