mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Return error when importmulti called with invalid address.
Lack of error checking noticed by Alex Morcos <morcos@chaincode.com>
This commit is contained in:
@@ -671,6 +671,9 @@ UniValue processImport(const UniValue& data) {
|
||||
|
||||
if (!isScript) {
|
||||
address = CBitcoinAddress(output);
|
||||
if (!address.IsValid()) {
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid address");
|
||||
}
|
||||
script = GetScriptForDestination(address.Get());
|
||||
} else {
|
||||
if (!IsHex(output)) {
|
||||
|
||||
Reference in New Issue
Block a user