commit 290857e: [Minor] Fix DKIM headers extraction

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 12 16:42:36 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-07-12 16:35:36 +0100
URL: https://github.com/rspamd/rspamd/commit/290857ea8d7238183f8cee461847dded0ab57e47

[Minor] Fix DKIM headers extraction

---
 src/libserver/dkim.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c
index 1cc72e65d..69226e595 100644
--- a/src/libserver/dkim.c
+++ b/src/libserver/dkim.c
@@ -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;


More information about the Commits mailing list