Skip to content

Commit fa8a992

Browse files
author
MarcoFalke
committed
Work around memory-aliasing in descriptor ParsePubkey
1 parent 37485ba commit fa8a992

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/script/descriptor.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,8 @@ std::unique_ptr<PubkeyProvider> ParsePubkey(uint32_t key_exp_index, const Span<c
826826
}
827827
if (origin_split.size() == 1) return ParsePubkeyInner(key_exp_index, origin_split[0], permit_uncompressed, out, error);
828828
if (origin_split[0].size() < 1 || origin_split[0][0] != '[') {
829-
error = strprintf("Key origin start '[ character expected but not found, got '%c' instead", origin_split[0][0]);
829+
error = strprintf("Key origin start '[ character expected but not found, got '%c' instead",
830+
origin_split[0].size() < 1 ? /** empty, implies split char */ ']' : origin_split[0][0]);
830831
return nullptr;
831832
}
832833
auto slash_split = Split(origin_split[0].subspan(1), '/');

0 commit comments

Comments
 (0)