]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] One more fix for spaces at the end of boundary
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Apr 2020 16:03:41 +0000 (17:03 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 27 Apr 2020 16:03:41 +0000 (17:03 +0100)
src/libmime/mime_parser.c

index 4038f59c6a24a5f37725c312c79351ea04842600..590ee57d6d1bbd127bbc5e15a6f8d33c7e2f4419 100644 (file)
@@ -1108,19 +1108,26 @@ rspamd_mime_preprocess_cb (struct rspamd_multipattern *mp,
                                bend ++;
                        }
 
-                       if (bend < end) {
+                       while (bend < end) {
                                if (*bend == '\r') {
-                                       bend++;
+                                       bend ++;
 
                                        /* \r\n */
                                        if (bend < end && *bend == '\n') {
-                                               bend++;
+                                               bend ++;
                                        }
                                }
-                               else {
+                               else if (*bend == '\n') {
                                        /* \n */
-                                       bend++;
+                                       bend ++;
                                }
+                               else if (g_ascii_isspace (*bend)){
+                                       /* Spaces in the same line, skip them */
+                                       bend ++;
+                                       continue;
+                               }
+
+                               break;
                        }
 
                        b.boundary = p - st->start - 2;