aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcdump.cpp
diff options
context:
space:
mode:
authorRussell Yanofsky <russ@yanofsky.org>2017-02-13 17:54:51 -0500
committerRussell Yanofsky <russ@yanofsky.org>2017-02-13 17:54:51 -0500
commit9acf25cc013c013ee5b07dba7b1319b7c5a7b6a4 (patch)
tree4565391074de7304a344e97c1418ada6ff11fc38 /src/wallet/rpcdump.cpp
parentd978c41e1ec4fcf2c4d096f09af035f9e8a7ad81 (diff)
Return error when importmulti called with invalid address.
Lack of error checking noticed by Alex Morcos <morcos@chaincode.com>
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r--src/wallet/rpcdump.cpp3
1 files changed, 3 insertions, 0 deletions
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)) {