]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Ignore space chars when detect CTE
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 30 Dec 2016 16:59:40 +0000 (16:59 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 30 Dec 2016 16:59:40 +0000 (16:59 +0000)
src/libmime/mime_parser.c

index 0ffde41001fb90f19fad973c7a054ff4a8c75970..bd976a9fc1a86d00d1e0454802508092a90edb00 100644 (file)
@@ -157,7 +157,15 @@ rspamd_mime_part_get_cte_heuristic (struct rspamd_task *task,
 
        real_len = MIN (check_len, part->raw_data.len);
        p = (const guchar *)part->raw_data.begin;
-       end = p + real_len;
+       end = p + part->raw_data.len;
+
+       while (p < end && g_ascii_isspace (*p)) {
+               p ++;
+       }
+
+       if (end - p > real_len) {
+               end = p + real_len;
+       }
 
        while (p < end) {
                if (*p == '\r' || *p == '\n') {