Merge pull request #6906

30d9662 Reject invalid pubkeys when reading ckey items from the wallet. (Gregory Maxwell)
This commit is contained in:
Wladimir J. van der Laan
2015-10-31 00:39:45 +01:00

View File

@ -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++;