DKIM Verification: Fix relaxed canon for empty headers w/o
[exim.git] / src / src / pdkim / pdkim.c
index 59ac39569d091e823adbd881cff18de1edaf6487..5960292d4c49e3b4afbaf1453f81b9e5918b8b78 100644 (file)
@@ -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;