diff options
author | Jeremy Rubin <j@rubin.io> | 2022-08-16 12:09:27 -0700 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2022-08-16 15:21:58 -0400 |
commit | 0652dc53b291bd295caff4093ec2854fd4b34645 (patch) | |
tree | 829da1a100c924c6122f7e8b3b884985dc7a1dd3 /src/psbt.h | |
parent | c336f813b3cd1d222d4b37cce3a6fbd855c5f4ad (diff) | |
download | bitcoin-0652dc53b291bd295caff4093ec2854fd4b34645.tar.xz |
[BugFix]: Do not allow deserializing PSBT with empty PSBT_OUT_TAP_TREE
Diffstat (limited to 'src/psbt.h')
-rw-r--r-- | src/psbt.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/psbt.h b/src/psbt.h index d5c67802c7..b8c35c9970 100644 --- a/src/psbt.h +++ b/src/psbt.h @@ -862,6 +862,9 @@ struct PSBTOutput std::vector<unsigned char> tree_v; s >> 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()) { uint8_t depth; uint8_t leaf_ver; |