Bug 1491755 - Fix 'truncated password' when using AUTH PLAIN (SMTP). r+a=jorgk
authorAlfred Peters <infofrommozilla@gmail.com>
Sun, 23 Sep 2018 08:01:00 +0200
changeset 31824 0e7a9aa6ed55
parent 31823 498a2e30c461
child 31825 03c944b00394
push id77
push usermozilla@jorgk.com
push dateSun, 23 Sep 2018 22:45:08 +0000
treeherdercomm-esr60@b63dc822b694 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1491755
Bug 1491755 - Fix 'truncated password' when using AUTH PLAIN (SMTP). r+a=jorgk
mailnews/compose/src/nsSmtpProtocol.cpp
--- a/mailnews/compose/src/nsSmtpProtocol.cpp
+++ b/mailnews/compose/src/nsSmtpProtocol.cpp
@@ -1512,17 +1512,17 @@ nsresult nsSmtpProtocol::AuthLoginStep1(
     char plain_string[512];
     int len = 1; /* first <NUL> char */
 
     memset(plain_string, 0, 512);
     PR_snprintf(&plain_string[1], 510, "%s", username.get());
     len += username.Length();
     len++; /* second <NUL> char */
     PR_snprintf(&plain_string[len], 511-len, "%s", uniPassword.get());
-    len += password.Length();
+    len += uniPassword.Length();
 
     base64Str = PL_Base64Encode(plain_string, len, nullptr);
     PR_snprintf(buffer, sizeof(buffer), "AUTH PLAIN %.256s" CRLF, base64Str);
   }
   else if (m_currentAuthMethod == SMTP_AUTH_LOGIN_ENABLED)
   {
     MOZ_LOG(SMTPLogModule, mozilla::LogLevel::Debug, ("LOGIN auth"));
     base64Str = PL_Base64Encode(username.get(),