Bug 1491755 - Fix 'truncated password' when using AUTH PLAIN (SMTP). r+a=jorgk
--- 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(),