Skip to content

Commit 0652dc5

Browse files
JeremyRubinachow101
authored andcommitted
[BugFix]: Do not allow deserializing PSBT with empty PSBT_OUT_TAP_TREE
1 parent c336f81 commit 0652dc5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/psbt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ struct PSBTOutput
862862
std::vector<unsigned char> tree_v;
863863
s >> tree_v;
864864
SpanReader s_tree(s.GetType(), s.GetVersion(), tree_v);
865+
if (s_tree.empty()) {
866+
throw std::ios_base::failure("Output Taproot tree must not be empty");
867+
}
865868
while (!s_tree.empty()) {
866869
uint8_t depth;
867870
uint8_t leaf_ver;

0 commit comments

Comments
 (0)