From 9acf25cc013c013ee5b07dba7b1319b7c5a7b6a4 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Mon, 13 Feb 2017 17:54:51 -0500 Subject: Return error when importmulti called with invalid address. Lack of error checking noticed by Alex Morcos --- src/wallet/rpcdump.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 7d4ed70ed9..738643eb01 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -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)) { -- cgit v1.2.3