diff options
| author | Gregory Sanders <[email protected]> | 2018-11-08 10:33:05 -0500 |
|---|---|---|
| committer | fanquake <[email protected]> | 2018-11-29 11:51:47 +0800 |
| commit | 5782fdcd8c516fd8cc236beefbd9c91e03957f6a (patch) | |
| tree | 8f386aa14bdeebe6a1fcee43595a5824a67529d9 /src | |
| parent | Bugfix: RPC: Add address_type named param for createmultisig (diff) | |
| download | discoin-5782fdcd8c516fd8cc236beefbd9c91e03957f6a.tar.xz discoin-5782fdcd8c516fd8cc236beefbd9c91e03957f6a.zip | |
Throw error if CPubKey is invalid during PSBT keypath serialization
Github-Pull: #14690
Rebased-From: 4e4de10f69d5d705256cadfb15d76314dff16e77
Diffstat (limited to 'src')
| -rw-r--r-- | src/script/sign.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/sign.h b/src/script/sign.h index 7ade715ee..245b15410 100644 --- a/src/script/sign.h +++ b/src/script/sign.h @@ -188,6 +188,9 @@ template<typename Stream> void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, std::vector<uint32_t>>& hd_keypaths, uint8_t type) { for (auto keypath_pair : hd_keypaths) { + if (!keypath_pair.first.IsValid()) { + throw std::ios_base::failure("Invalid CPubKey being serialized"); + } SerializeToVector(s, type, MakeSpan(keypath_pair.first)); WriteCompactSize(s, keypath_pair.second.size() * sizeof(uint32_t)); for (auto& path : keypath_pair.second) { |