diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-23 10:52:49 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-23 10:53:05 +0200 |
commit | bfe527ea86154e99dd1674712d76f39609ba4bf9 (patch) | |
tree | 27c19b24810ec9922f063236b5c270aa1d16bc66 | |
parent | 2027450d4270afdde691f71231f5c81282c2e711 (diff) | |
parent | 6f3ae9b5df1a65c47aeb221afcf079b0fae566d4 (diff) |
Merge pull request #4962
6f3ae9b Fixing out of bounds error in GetKey() (ENikS)
-rw-r--r-- | src/base58.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/base58.cpp b/src/base58.cpp index 9750f0a161..d94db2c51b 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -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; } |