Skip to content

Commit aa633c8

Browse files
kazcwfurszy
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.
1 parent 0b77f8a commit aa633c8

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
@@ -198,7 +198,7 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)
198198
vchData.resize(vchTemp.size() - nVersionBytes);
199199
if (!vchData.empty())
200200
memcpy(&vchData[0], &vchTemp[nVersionBytes], vchData.size());
201-
memory_cleanse(&vchTemp[0], vchData.size());
201+
memory_cleanse(&vchTemp[0], vchTemp.size());
202202
return true;
203203
}
204204

0 commit comments

Comments
 (0)