CBase58Data::SetString: cleanse the full vector

SetString seems to be passing the length of the wrong variable to
memory_cleanse, resulting in the last byte of the temporary buffer not being
securely erased.
This commit is contained in:
Kaz Wesley 2016-04-18 14:56:02 -07:00 committed by Jack Grigg
parent 0e65c245f7
commit 63822fbc84
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 1 additions and 1 deletions

View File

@ -175,7 +175,7 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
vchData.resize(vchTemp.size() - nVersionBytes);
if (!vchData.empty())
memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
memory_cleanse(&vchTemp[0], vchData.size());
memory_cleanse(&vchTemp[0], vchTemp.size());
return true;
}