From: Richard Russon Date: Fri, 6 Jul 2018 09:33:25 +0000 (+0100) Subject: Fix imap auth plain X-Git-Tag: neomutt-20180716~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=51c4efb8ccae3dab550fe8909fc76fb2462f0a89;p=neomutt Fix imap auth plain Send the password and `\r\n` as one message. Fixes #1286 --- diff --git a/imap/auth_plain.c b/imap/auth_plain.c index 6b63c3944..7967d90ef 100644 --- a/imap/auth_plain.c +++ b/imap/auth_plain.c @@ -48,7 +48,7 @@ enum ImapAuthRes imap_auth_plain(struct ImapData *idata, const char *method) int rc = IMAP_CMD_CONTINUE; enum ImapAuthRes res = IMAP_AUTH_SUCCESS; static const char auth_plain_cmd[] = "AUTHENTICATE PLAIN"; - char buf[STRING]; + char buf[STRING] = { 0 }; if (mutt_account_getuser(&idata->conn->account) < 0) return IMAP_AUTH_FAILURE; @@ -77,8 +77,8 @@ enum ImapAuthRes imap_auth_plain(struct ImapData *idata, const char *method) } if (rc == IMAP_CMD_RESPOND) { + mutt_str_strcat(buf + sizeof(auth_plain_cmd), sizeof(buf) - sizeof(auth_plain_cmd), "\r\n"); mutt_socket_send(idata->conn, buf + sizeof(auth_plain_cmd)); - mutt_socket_send(idata->conn, "\r\n"); } }