aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2018-11-08 10:33:05 -0500
committerGregory Sanders <gsanders87@gmail.com>2018-11-08 10:51:20 -0500
commit4e4de10f69d5d705256cadfb15d76314dff16e77 (patch)
tree05dfd838d8e5746c5624b67388f671854a37fb05 /src/script
parent6b8d0a2164b30eab76e7bccb1ffb056a10fba406 (diff)
downloadbitcoin-4e4de10f69d5d705256cadfb15d76314dff16e77.tar.xz
Throw error if CPubKey is invalid during PSBT keypath serialization
Diffstat (limited to 'src/script')
-rw-r--r--src/script/sign.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/script/sign.h b/src/script/sign.h
index d47aada17d..546d14e75c 100644
--- a/src/script/sign.h
+++ b/src/script/sign.h
@@ -206,6 +206,9 @@ template<typename Stream>
void SerializeHDKeypaths(Stream& s, const std::map<CPubKey, KeyOriginInfo>& 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.path.size() + 1) * sizeof(uint32_t));
s << keypath_pair.second.fingerprint;