Browse Source

Merge pull request #4962

6f3ae9b Fixing out of bounds error in GetKey() (ENikS)
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
bfe527ea86
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 3
      src/base58.cpp

3
src/base58.cpp

@ -288,7 +288,8 @@ void CBitcoinSecret::SetKey(const CKey& vchSecret) @@ -288,7 +288,8 @@ void CBitcoinSecret::SetKey(const CKey& vchSecret)
CKey CBitcoinSecret::GetKey()
{
CKey ret;
ret.Set(&vchData[0], &vchData[32], vchData.size() > 32 && vchData[32] == 1);
assert(vchData.size() >= 32);
ret.Set(vchData.begin(), vchData.begin() + 32, vchData.size() > 32 && vchData[32] == 1);
return ret;
}

Loading…
Cancel
Save