From 6f3ae9b5df1a65c47aeb221afcf079b0fae566d4 Mon Sep 17 00:00:00 2001 From: ENikS Date: Mon, 22 Sep 2014 16:24:42 -0400 Subject: [PATCH] Fixing out of bounds error in GetKey() --- src/base58.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base58.cpp b/src/base58.cpp index 9750f0a161d..d94db2c51b1 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; }