]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix DKIM headers extraction
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 12 Jul 2019 15:35:36 +0000 (16:35 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 12 Jul 2019 15:35:36 +0000 (16:35 +0100)
src/libserver/dkim.c

index 1cc72e65d756602cc267846c2afc98f788a30839..69226e5955d502484a7c0008f8d66953a15a5a5f 100644 (file)
@@ -2172,14 +2172,14 @@ rspamd_dkim_canonize_header (struct rspamd_dkim_common_ctx *ctx,
                rh = rspamd_message_get_header_array (task, header_name);
 
                if (rh) {
-                       /* Check uniqueness of the header */
+                       /* Check uniqueness of the header but we count from the bottom to top */
                        for (cur = rh->prev; ; cur = cur->prev) {
-                               hdr_cnt ++;
-
                                if (hdr_cnt == count) {
                                        sel = cur;
                                }
 
+                               hdr_cnt ++;
+
                                if (cur->next == NULL) {
                                        /* Cycle */
                                        break;