From 6cb614e6194de39fafd4eb05ad69a1b4aeef17f1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 15 Nov 2014 19:49:29 +0000 Subject: [PATCH] Fix buffer update for DKIM. Sometimes this procedure was able to split \r\n in messages which in turn led to DKIM checks failures. --- src/libserver/dkim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 3c63e7280..7d0532276 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1069,6 +1069,14 @@ rspamd_dkim_relaxed_body_step (GChecksum *ck, const gchar **start, guint size, len--; continue; } + else if (inlen < 2) { + /* + * Inlen is too small to continue, hence we need more iteration to + * avoid splitted \r\n + */ + finished = FALSE; + break; + } } else if (g_ascii_isspace (*h)) { if (got_sp) { -- 2.39.5