[exim-cvs] Bugzilla #1067 - DKIM: Fix relaxed header canon f…

Góra strony
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Dla: exim-cvs
Temat: [exim-cvs] Bugzilla #1067 - DKIM: Fix relaxed header canon for headers ending with whitespace.
Gitweb: http://git.exim.org/exim.git/commitdiff/57f4f29c7480042d611c87d532dd3d89c1fc21f0
Commit:     57f4f29c7480042d611c87d532dd3d89c1fc21f0
Parent:     379120bf2593f7ff93e939239b2070444e996be3
Author:     Tom Kistner <tom@???>
AuthorDate: Wed Jan 12 20:48:22 2011 +0000
Committer:  Tom Kistner <tom@???>
CommitDate: Wed Jan 12 20:48:22 2011 +0000


    Bugzilla #1067 - DKIM: Fix relaxed header canon for headers ending with whitespace.
---
 src/src/pdkim/pdkim.c     |    1 +
 src/src/transports/smtp.c |    4 +---
 2 files changed, 2 insertions(+), 3 deletions(-)


diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c
index fa5d88d..0147f5f 100644
--- a/src/src/pdkim/pdkim.c
+++ b/src/src/pdkim/pdkim.c
@@ -420,6 +420,7 @@ char *pdkim_relax_header (char *header, int crlf) {
     p++;
     q++;
   }
+  if (seen_wsp) q--;
   *q = '\0';
   if (crlf) strcat(relaxed,"\r\n");
   return relaxed;
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index 41796a4..fb55ae0 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -1078,12 +1078,10 @@ 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. */