[exim-cvs] DKIM Verification: Fix relaxed canon for empty he…

Página Inicial
Delete this message
Reply to this message
Autor: Exim Git Commits Mailing List
Data:  
Para: exim-cvs
Assunto: [exim-cvs] DKIM Verification: Fix relaxed canon for empty headers w/o
Gitweb: http://git.exim.org/exim.git/commitdiff/ab42bd23609158bd5c00e3e4bd02535a3d9af5af
Commit:     ab42bd23609158bd5c00e3e4bd02535a3d9af5af
Parent:     f1a29782e1db8bae2bdadf1335c3687cb8b820f6
Author:     Tom Kistner <tom@???>
AuthorDate: Sun Jun 5 17:08:36 2011 +0100
Committer:  Tom Kistner <tom@???>
CommitDate: Sun Jun 5 17:08:36 2011 +0100


    DKIM Verification: Fix relaxed canon for empty headers w/o
    whitespace trailer
---
 doc/doc-txt/ChangeLog |    2 ++
 src/src/pdkim/pdkim.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)


diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index e782b9e..dc8e043 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -11,6 +11,8 @@ PP/01 Solaris build fix for Oracle's LDAP libraries.

TF/01 HP/UX build fix: avoid arithmetic on a void pointer.

+TK/01 DKIM Verification: Fix relaxed canon for empty headers w/o
+      whitespace trailer


 Exim version 4.76
 -----------------
diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c
index 59ac395..5960292 100644
--- a/src/src/pdkim/pdkim.c
+++ b/src/src/pdkim/pdkim.c
@@ -420,7 +420,7 @@ char *pdkim_relax_header (char *header, int crlf) {
     p++;
     q++;
   }
-  if (seen_wsp) q--;
+  if ((q>relaxed) && (*(q-1) == ' ')) q--; /* Squash eventual trailing SP */
   *q = '\0';
   if (crlf) strcat(relaxed,"\r\n");
   return relaxed;