From: Vsevolod Stakhov Date: Thu, 23 Feb 2017 15:37:41 +0000 (+0000) Subject: [Fix] Fix ignoring of bad text parts X-Git-Tag: 1.5.0~47 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ec30a062cbef3f1709a7412007a05b11136450a9;p=rspamd.git [Fix] Fix ignoring of bad text parts --- diff --git a/src/libmime/message.c b/src/libmime/message.c index 616a798e1..8b7acc22f 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -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; + } } diff --git a/src/libmime/mime_encoding.c b/src/libmime/mime_encoding.c index 4d5f71be1..59df89ece 100644 --- a/src/libmime/mime_encoding.c +++ b/src/libmime/mime_encoding.c @@ -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);