BugZilla 1006 - recommit patch from Micha Lenk
authorTom Kistner <tom@tahini.csx.cam.ac.uk>
Mon, 14 Feb 2011 19:24:00 +0000 (19:24 +0000)
committerTom Kistner <tom@tahini.csx.cam.ac.uk>
Mon, 14 Feb 2011 19:24:00 +0000 (19:24 +0000)
src/src/transports/smtp.c

index e06631f2fa50b4656cc046e5ce2a21dc01d6dd7c..548fbfc0e50139b4ccaae18249f68fbf2fdb63ae 100644 (file)
@@ -1078,10 +1078,12 @@ if (tls_offered && !suppress_tls &&
   if (!smtp_read_response(&inblock, buffer2, sizeof(buffer2), '2',
       ob->command_timeout))
     {
-    Ustrncpy(buffer, buffer2, sizeof(buffer));
     if (errno != 0 || buffer2[0] == 0 ||
          (buffer2[0] == '4' && !ob->tls_tempfail_tryclear))
+      {
+      Ustrncpy(buffer, buffer2, sizeof(buffer));
       goto RESPONSE_FAILED;
+      }
     }
 
   /* STARTTLS accepted: try to negotiate a TLS session. */