aboutsummaryrefslogtreecommitdiff
path: root/src/script/descriptor.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-13 22:00:40 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-07-13 21:58:10 +0200
commitfa8a99258947a9ee3749fa472180542920cd471c (patch)
treeb76fb039c87ada4d39bb73f793e04e93ba6d405c /src/script/descriptor.cpp
parent37485baa275147470aa605e30654a8e42b3f9532 (diff)
Work around memory-aliasing in descriptor ParsePubkey
Diffstat (limited to 'src/script/descriptor.cpp')
-rw-r--r--src/script/descriptor.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp
index 5fa128d62d..6c5961f60e 100644
--- a/src/script/descriptor.cpp
+++ b/src/script/descriptor.cpp
@@ -826,7 +826,8 @@ std::unique_ptr<PubkeyProvider> ParsePubkey(uint32_t key_exp_index, const Span<c
}
if (origin_split.size() == 1) return ParsePubkeyInner(key_exp_index, origin_split[0], permit_uncompressed, out, error);
if (origin_split[0].size() < 1 || origin_split[0][0] != '[') {
- error = strprintf("Key origin start '[ character expected but not found, got '%c' instead", origin_split[0][0]);
+ error = strprintf("Key origin start '[ character expected but not found, got '%c' instead",
+ origin_split[0].size() < 1 ? /** empty, implies split char */ ']' : origin_split[0][0]);
return nullptr;
}
auto slash_split = Split(origin_split[0].subspan(1), '/');