Browse Source

Merge pull request #6906

30d9662 Reject invalid pubkeys when reading ckey items from the wallet. (Gregory Maxwell)
0.13
Wladimir J. van der Laan 9 years ago
parent
commit
48b5b84ee5
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 7
      src/wallet/walletdb.cpp

7
src/wallet/walletdb.cpp

@ -512,8 +512,13 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, @@ -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++;

Loading…
Cancel
Save