diff options
author | ENikS <evgeni@eniks.com> | 2014-09-22 16:24:42 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-09-23 10:45:04 +0200 |
commit | 6f3ae9b5df1a65c47aeb221afcf079b0fae566d4 (patch) | |
tree | 07844c9d834993540b39f42a4f4418260e25dd00 /src/base58.cpp | |
parent | cb9871194a7fffe8bc0a53ea820b1a395e79e283 (diff) |
Fixing out of bounds error in GetKey()
Diffstat (limited to 'src/base58.cpp')
-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; } |