mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
psbt: Fix unsigned integer overflow
This commit is contained in:
parent
5057adf22f
commit
4fa79837ad
@ -893,6 +893,9 @@ struct PSBTOutput
|
||||
s >> leaf_hashes;
|
||||
size_t after_hashes = s.size();
|
||||
size_t hashes_len = before_hashes - after_hashes;
|
||||
if (hashes_len > value_len) {
|
||||
throw std::ios_base::failure("Output Taproot BIP32 keypath has an invalid length");
|
||||
}
|
||||
size_t origin_len = value_len - hashes_len;
|
||||
m_tap_bip32_paths.emplace(xonly, std::make_pair(leaf_hashes, DeserializeKeyOrigin(s, origin_len)));
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user