aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-09-23 10:52:49 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-09-23 10:53:05 +0200
commitbfe527ea86154e99dd1674712d76f39609ba4bf9 (patch)
tree27c19b24810ec9922f063236b5c270aa1d16bc66 /src
parent2027450d4270afdde691f71231f5c81282c2e711 (diff)
parent6f3ae9b5df1a65c47aeb221afcf079b0fae566d4 (diff)
Merge pull request #4962
6f3ae9b Fixing out of bounds error in GetKey() (ENikS)
Diffstat (limited to 'src')
-rw-r--r--src/base58.cpp3
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;
}