mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-17 04:11:33 +02:00
descriptor: check whitespace in ParsePubkeyInner
Due to Base58, keys with whitespace at the beginning or at the end are successfully parsed. This commit adds a check into `ParsePubkeyInner` to verify whether if the first or last char of the key is a space.
This commit is contained in:
parent
50856695ef
commit
cb722a3cea
@ -1509,6 +1509,10 @@ std::vector<std::unique_ptr<PubkeyProvider>> ParsePubkeyInner(uint32_t key_exp_i
|
||||
error = "No key provided";
|
||||
return {};
|
||||
}
|
||||
if (IsSpace(str.front()) || IsSpace(str.back())) {
|
||||
error = strprintf("Key '%s' is invalid due to whitespace", str);
|
||||
return {};
|
||||
}
|
||||
if (split.size() == 1) {
|
||||
if (IsHex(str)) {
|
||||
std::vector<unsigned char> data = ParseHex(str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user