diff options
Diffstat (limited to 'src')
-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; } |