]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix ignoring of bad text parts
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 23 Feb 2017 15:37:41 +0000 (15:37 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 23 Feb 2017 15:37:41 +0000 (15:37 +0000)
src/libmime/message.c
src/libmime/mime_encoding.c

index 616a798e15141d3572c15170a7a9634b9ed8d26a..8b7acc22f35fde987c450637eed08b96b91ecb9f 100644 (file)
@@ -490,13 +490,16 @@ rspamd_message_process_text_part (struct rspamd_task *task,
                text_part->content = rspamd_mime_text_part_maybe_convert (task,
                                text_part);
 
-               if (text_part->content == NULL) {
+               if (text_part->content != NULL) {
                        /*
                         * We ignore unconverted parts from now as it is dangerous
                         * to treat them as text parts
                         */
                        g_ptr_array_add (task->text_parts, text_part);
                }
+               else {
+                       return;
+               }
        }
 
 
index 4d5f71be1afd5750ee10694ab9715863322d49a8..59df89ece331d88d08eef7c36943545ef318e751 100644 (file)
@@ -453,7 +453,7 @@ rspamd_mime_text_part_maybe_convert (struct rspamd_task *task,
                msg_info_task ("<%s>: has invalid charset", task->message_id);
                SET_PART_RAW (text_part);
 
-               return part_content;
+               return NULL;
        }
 
        RSPAMD_FTOK_FROM_STR (&charset_tok, charset);