From: Vsevolod Stakhov Date: Tue, 18 Nov 2014 14:27:35 +0000 (+0000) Subject: Apply boundary fix for dkim simple canonization. X-Git-Tag: 0.7.6~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c784852f1c153650343c1feebe6d2a1bda3c5c39;p=thirdparty%2Frspamd.git Apply boundary fix for dkim simple canonization. --- diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 112de7cd22..b8b92700b7 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--;