]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[CritFix] Fix newlines detection
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 21 Oct 2017 13:53:17 +0000 (14:53 +0100)
committerAndrew Lewis <nerf@judo.za.org>
Sat, 21 Oct 2017 19:03:22 +0000 (21:03 +0200)
MFH: rspamd-1.6

src/libmime/message.c

index 7bc9bf2c2d4323d8b11ad47bee2dc1799d5ce2bf..92650ba921253dba0da2bae6b50dc9035e439ae3 100644 (file)
@@ -410,6 +410,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 {
@@ -478,6 +480,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) {