Permalink
Browse files

Merge pull request #6906

30d9662 Reject invalid pubkeys when reading ckey items from the wallet. (Gregory Maxwell)
  • Loading branch information...
laanwj committed Oct 30, 2015
2 parents d482c0a + 30d9662 commit 48b5b84ee511d5ccd0d47bb0018c1b3c9ddebeff
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/wallet/walletdb.cpp
View
@@ -512,8 +512,13 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
}
else if (strType == "ckey")
{
vector<unsigned char> vchPubKey;
CPubKey vchPubKey;
ssKey >> vchPubKey;
if (!vchPubKey.IsValid())
{
strErr = "Error reading wallet database: CPubKey corrupt";
return false;
}
vector<unsigned char> vchPrivKey;
ssValue >> vchPrivKey;
wss.nCKeys++;

0 comments on commit 48b5b84

Please sign in to comment.