mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
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:
parent
59ad56851a
commit
57704499be
1 changed files with 1 additions and 1 deletions
|
@ -177,7 +177,7 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
|
||||||
vchData.resize(vchTemp.size() - nVersionBytes);
|
vchData.resize(vchTemp.size() - nVersionBytes);
|
||||||
if (!vchData.empty())
|
if (!vchData.empty())
|
||||||
memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
|
memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
|
||||||
memory_cleanse(&vchTemp[0], vchData.size());
|
memory_cleanse(&vchTemp[0], vchTemp.size());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue