]> source.dussan.org Git - rspamd.git/commitdiff
[CritFix] Fix SA rawbody processing - exclude top part
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Apr 2016 14:05:28 +0000 (15:05 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 28 Apr 2016 14:06:14 +0000 (15:06 +0100)
src/libserver/re_cache.c

index db57c0db9681df8ccecc86e39e58e598c0baad18..be7394c44b3891b038f2b09510fd072b5123ec1e 100644 (file)
@@ -959,6 +959,15 @@ rspamd_re_cache_exec_re (struct rspamd_task *task,
                        for (i = 0; i < task->parts->len; i++) {
                                mime_part = g_ptr_array_index (task->parts, i);
 
+                               if (mime_part->parent == NULL) {
+                                       /* Top level part */
+                                       scvec[i * 2 + 1] = (guchar *)"";
+                                       lenvec[i * 2 + 1] = 0;
+                                       scvec[i * 2 + 2] = (guchar *)"";
+                                       lenvec[i * 2 + 2] = 0;
+                                       continue;
+                               }
+
                                if (mime_part->raw_headers_str) {
                                        scvec[i * 2 + 1] = (guchar *)mime_part->raw_headers_str;
                                        lenvec[i * 2 + 1] = strlen (mime_part->raw_headers_str);