aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/message.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-13 14:47:25 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-08-13 14:47:25 +0100
commit6dcd2bd6760bdf33c953d89e5c6752a3154bd4ab (patch)
tree3f4d672d80725614863b0550110ca79c5c03241d /src/libmime/message.c
parentc3ca41d039721004af10cf77083ccebb4b3a0bb8 (diff)
downloadrspamd-6dcd2bd6760bdf33c953d89e5c6752a3154bd4ab.tar.gz
rspamd-6dcd2bd6760bdf33c953d89e5c6752a3154bd4ab.zip
[Fix] Fix more issues with nested messages + tests
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r--src/libmime/message.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 7eec503c9..90df43b12 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1412,20 +1412,21 @@ rspamd_message_process (struct rspamd_task *task)
PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, parts), i, part) {
if (!rspamd_message_process_text_part_maybe (task, part) &&
part->parsed_data.len > 0) {
- const gchar *mb = magic_buffer (task->cfg->libs_ctx->libmagic,
- part->parsed_data.begin,
- part->parsed_data.len);
-
- if (mb) {
- rspamd_ftok_t srch;
-
- srch.begin = mb;
- srch.len = strlen (mb);
- part->detected_ct = rspamd_content_type_parse (srch.begin,
- srch.len,
- task->task_pool);
+ if (task->cfg) {
+ const gchar *mb = magic_buffer (task->cfg->libs_ctx->libmagic,
+ part->parsed_data.begin,
+ part->parsed_data.len);
+
+ if (mb) {
+ rspamd_ftok_t srch;
+
+ srch.begin = mb;
+ srch.len = strlen (mb);
+ part->detected_ct = rspamd_content_type_parse (srch.begin,
+ srch.len,
+ task->task_pool);
+ }
}
-
}
}