mirror of
https://github.com/kvazar-network/kevacoin.git
synced 2025-01-18 19:10:11 +00:00
Reject invalid pubkeys when reading ckey items from the wallet.
This makes the behavior more consistent with key objects and will reject some corrupted pubkeys (e.g. zero length).
This commit is contained in:
parent
725539ea03
commit
30d9662bd7
@ -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…
x
Reference in New Issue
Block a user