Skip to content

Commit

Permalink
CBase58Data::SetString: cleanse the full vector
Browse files Browse the repository at this point in the history
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.

Github-Pull: bitcoin#7922
Rebased-From: 5770449
  • Loading branch information
kazcw authored and thokon00 committed Jun 28, 2016
1 parent f4cb7eb commit a6cab88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,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;
}

Expand Down

0 comments on commit a6cab88

Please sign in to comment.