From aa768f1848b00e0fd615016598d3fb1f1da240ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Jan=C3=ADk?= Date: Thu, 11 Dec 2014 16:06:23 +0100 Subject: [PATCH] signrawtransaction: validate private key. --- src/rpcrawtransaction.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 8de15ff9e2..4a1af2207a 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -587,6 +587,8 @@ Value signrawtransaction(const Array& params, bool fHelp) if (!fGood) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid private key"); CKey key = vchSecret.GetKey(); + if (!key.IsValid()) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Private key outside allowed range"); tempKeystore.AddKey(key); } }