]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
smtp.c: Fixed use of angled brackets in AUTH parameter.
authorSteve Holme <steve_holme@hotmail.com>
Sat, 7 Jan 2012 13:42:28 +0000 (13:42 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 15 Feb 2012 20:51:45 +0000 (21:51 +0100)
Fixed the use of angled brackets "<>" in the optional AUTH parameter as
per RFC-2554 section 5. The address should not include them but an
empty address should be replaced by them.

lib/smtp.c

index c02c9bdd469e67b4dae2809cce37aa2a21d1d2f9..fa5452affc3ed63ea3905d7ef7ade5135427cb62 100644 (file)
@@ -912,10 +912,11 @@ static CURLcode smtp_mail(struct connectdata *conn)
 
   /* calculate the optional AUTH parameter */
   if(data->set.str[STRING_MAIL_AUTH] && conn->proto.smtpc.authused) {
-    if(data->set.str[STRING_MAIL_AUTH][0] == '<')
+    if(data->set.str[STRING_MAIL_AUTH][0] != '\0')
       auth = aprintf("%s", data->set.str[STRING_MAIL_AUTH]);
     else
-      auth = aprintf("<%s>", data->set.str[STRING_MAIL_AUTH]);
+      /* empty AUTH, RFC-2554, sect. 5 */
+      auth = strdup("<>");
 
     if(!auth) {
       Curl_safefree(from);