]> source.dussan.org Git - rspamd.git/commitdiff
[CritFix] Fix newlines detection
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 21 Oct 2017 13:53:17 +0000 (14:53 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 21 Oct 2017 13:53:17 +0000 (14:53 +0100)
MFH: rspamd-1.6

src/libmime/message.c

index fe2cdbdae92900af309dac52e79afd4d88e0694f..36ce710fc3e59f1a84658f449701205bc38466ab 100644 (file)
@@ -413,6 +413,8 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
                                if (IS_PART_HTML (part) || g_ascii_ispunct (last_c)) {
                                        g_byte_array_append (part->stripped_content,
                                                        (const guint8 *)" ", 1);
+                                       g_ptr_array_add (part->newlines,
+                                                       (((gpointer) (goffset) (part->stripped_content->len))));
                                        crlf_added = TRUE;
                                }
                                else {
@@ -488,6 +490,11 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
                        case seen_lf:
                                part->nlines ++;
 
+                               if (!crlf_added) {
+                                       g_ptr_array_add (part->newlines,
+                                                       (((gpointer) (goffset) (part->stripped_content->len))));
+                               }
+
                                /* Skip initial spaces */
                                if (G_UNLIKELY (*p == ' ')) {
                                        if (!crlf_added) {