]> source.dussan.org Git - rspamd.git/commitdiff
Fix buffer update for DKIM.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 15 Nov 2014 19:49:29 +0000 (19:49 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 15 Nov 2014 19:49:29 +0000 (19:49 +0000)
Sometimes this procedure was able to split \r\n in messages which in
turn led to DKIM checks failures.

src/libserver/dkim.c

index 3c63e7280df6310116e52dcbd217df550766a26c..7d05322769c3e7358894e2ab115560221726cb54 100644 (file)
@@ -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) {