Make GetPass() return a CString instead of a char*

In theory this could lead to extra copies of the password in memory, but since
no caller actually makes sure that those passwords are forgotten as fast as
possible, I don't see why this should be done the Old Way(tm).


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1343 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2009-01-23 18:46:39 +00:00
parent a92694c471
commit 7ab0b8d959
4 changed files with 8 additions and 12 deletions
+3 -5
View File
@@ -71,12 +71,10 @@ public:
{
if (m_sPassword.empty())
{
char *pTmp = CUtils::GetPass("Enter Encryption Key for " + GetModName() + ".so");
CString sTmp = CUtils::GetPass("Enter Encryption Key for " + GetModName() + ".so");
if (pTmp)
m_sPassword = CBlowfish::MD5(pTmp);
*pTmp = 0;
if (!sTmp.empty())
m_sPassword = CBlowfish::MD5(sTmp);
}
const vector<CChan *>& vChans = m_pUser->GetChans();