From a5399b9f5e3797ecfec1575e0cd5613956fa3295 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Sun, 5 Dec 2004 19:20:19 +0000 Subject: [PATCH] fixes bug 253394 "nsFtpState::S_user leaks user & password string" patch by jon@rekai.net r+sr=darin git-svn-id: svn://10.0.0.236/trunk@166273 18797224-902f-48f8-a5cc-f745e15eee43 --- .../netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp index 24e52b05eab..3c3407bef7c 100644 --- a/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp +++ b/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp @@ -1025,7 +1025,7 @@ nsFtpState::S_user() { } else { if (mUsername.IsEmpty()) { if (!mAuthPrompter) return NS_ERROR_NOT_INITIALIZED; - PRUnichar *user = nsnull, *passwd = nsnull; + nsXPIDLString user, passwd; PRBool retval; nsCAutoString prePath; rv = mURL->GetPrePath(prePath); @@ -1048,8 +1048,8 @@ nsFtpState::S_user() { formatedString, prePathU.get(), nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY, - &user, - &passwd, + getter_Copies(user), + getter_Copies(passwd), &retval); // if the user canceled or didn't supply a username we want to fail @@ -1125,7 +1125,7 @@ nsFtpState::S_pass() { if (mPassword.IsEmpty() || mRetryPass) { if (!mAuthPrompter) return NS_ERROR_NOT_INITIALIZED; - PRUnichar *passwd = nsnull; + nsXPIDLString passwd; PRBool retval; nsCAutoString prePath; @@ -1150,7 +1150,7 @@ nsFtpState::S_pass() { formatedString, prePathU.get(), nsIAuthPrompt::SAVE_PASSWORD_PERMANENTLY, - &passwd, &retval); + getter_Copies(passwd), &retval); // we want to fail if the user canceled. Note here that if they want // a blank password, we will pass it along.