From: Vsevolod Stakhov Date: Sat, 15 Nov 2014 19:49:29 +0000 (+0000) Subject: Fix buffer update for DKIM. X-Git-Tag: 0.7.5~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6cb614e6194de39fafd4eb05ad69a1b4aeef17f1;p=rspamd.git Fix buffer update for DKIM. Sometimes this procedure was able to split \r\n in messages which in turn led to DKIM checks failures. --- 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) {