mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-13 11:25:02 -05:00
Merge pull request #6906
30d9662
Reject invalid pubkeys when reading ckey items from the wallet. (Gregory Maxwell)
This commit is contained in:
commit
48b5b84ee5
1 changed files with 6 additions and 1 deletions
|
@ -512,8 +512,13 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue,
|
||||||
}
|
}
|
||||||
else if (strType == "ckey")
|
else if (strType == "ckey")
|
||||||
{
|
{
|
||||||
vector<unsigned char> vchPubKey;
|
CPubKey vchPubKey;
|
||||||
ssKey >> vchPubKey;
|
ssKey >> vchPubKey;
|
||||||
|
if (!vchPubKey.IsValid())
|
||||||
|
{
|
||||||
|
strErr = "Error reading wallet database: CPubKey corrupt";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
vector<unsigned char> vchPrivKey;
|
vector<unsigned char> vchPrivKey;
|
||||||
ssValue >> vchPrivKey;
|
ssValue >> vchPrivKey;
|
||||||
wss.nCKeys++;
|
wss.nCKeys++;
|
||||||
|
|
Loading…
Add table
Reference in a new issue