Skip to content

Commit c3d1bc3

Browse files
kazcwMarcoFalke
authored andcommitted
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. Github-Pull: #7922 Rebased-From: 5770449
1 parent 43c14ac commit c3d1bc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/base58.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
172172
vchData.resize(vchTemp.size() - nVersionBytes);
173173
if (!vchData.empty())
174174
memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
175-
memory_cleanse(&vchTemp[0], vchData.size());
175+
memory_cleanse(&vchTemp[0], vchTemp.size());
176176
return true;
177177
}
178178

0 commit comments

Comments
 (0)