]> code.citadel.org Git - citadel.git/commitdiff
Applied ninjadroid's patch for removing the
authorArt Cancro <ajc@citadel.org>
Thu, 15 Mar 2007 20:56:39 +0000 (20:56 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 15 Mar 2007 20:56:39 +0000 (20:56 +0000)
extra null character from the end of SMTP AUTH PLAIN strings.

citadel/serv_smtp.c

index 6aaaa9296a689d119d225894dbf0e33d50fcae36..569af12bb10bdbda606008d1641768cdb5f20db9 100644 (file)
@@ -1193,8 +1193,8 @@ void smtp_try(const char *key, const char *addr, int *status,
 
        /* Do an AUTH command if necessary */
        if (strlen(mx_user) > 0) {
-               sprintf(buf, "%s%c%s%c%s%c", mx_user, 0, mx_user, 0, mx_pass, 0);
-               CtdlEncodeBase64(mailfrom, buf, strlen(mx_user) + strlen(mx_user) + strlen(mx_pass) + 3);
+               sprintf(buf, "%s%c%s%c%s", mx_user, '\0', mx_user, '\0', mx_pass);
+               CtdlEncodeBase64(mailfrom, buf, strlen(mx_user) + strlen(mx_user) + strlen(mx_pass) + 2);
                snprintf(buf, sizeof buf, "AUTH PLAIN %s\r\n", mailfrom);
                lprintf(CTDL_DEBUG, ">%s", buf);
                sock_write(sock, buf, strlen(buf));