mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-03 20:35:17 +02:00
refactor: Add sanity checks in LabelFromValue
This commit is contained in:
@@ -132,7 +132,10 @@ const LegacyScriptPubKeyMan& EnsureConstLegacyScriptPubKeyMan(const CWallet& wal
|
||||
|
||||
std::string LabelFromValue(const UniValue& value)
|
||||
{
|
||||
std::string label = value.get_str();
|
||||
static const std::string empty_string;
|
||||
if (value.isNull()) return empty_string;
|
||||
|
||||
const std::string& label{value.get_str()};
|
||||
if (label == "*")
|
||||
throw JSONRPCError(RPC_WALLET_INVALID_LABEL_NAME, "Invalid label name");
|
||||
return label;
|
||||
|
||||
Reference in New Issue
Block a user