From d250836efb7a2a218aa4e9d25d7edcf11c42e389 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 5 Nov 2014 16:12:03 +0000 Subject: [PATCH] More fixes to dkim \r\n converting. Found by: @citrin --- 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 55b7cd331..df06dfe32 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -1102,10 +1102,10 @@ rspamd_dkim_relaxed_body_step (GChecksum *ck, const gchar **start, guint size, } if (*remain > 0) { - size_t cklen = MIN(t - buf, *remain); + size_t cklen = MIN(t - buf, *remain + added); g_checksum_update (ck, buf, cklen); *remain = *remain - (cklen - added); -#if 0 +#if 1 msg_debug ("update signature with buffer (%ud size, %ud remain): %*s", cklen, *remain, cklen, buf); #endif @@ -1169,7 +1169,7 @@ rspamd_dkim_simple_body_step (GChecksum *ck, const gchar **start, guint size, msg_debug ("update signature with buffer: %*s", t - buf, buf); #endif if (*remain > 0) { - size_t cklen = MIN(t - buf, *remain); + size_t cklen = MIN(t - buf, *remain + added); g_checksum_update (ck, buf, cklen); *remain = *remain - (cklen - added); } -- 2.39.5