From c784852f1c153650343c1feebe6d2a1bda3c5c39 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 18 Nov 2014 14:27:35 +0000 Subject: [PATCH] Apply boundary fix for dkim simple canonization. --- src/libserver/dkim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 112de7cd2..b8b92700b 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1169,6 +1169,14 @@ rspamd_dkim_simple_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; + } } *t++ = *h++; inlen--; -- 2.39.5