aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/message.c
diff options
context:
space:
mode:
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);
+ }
}
-
}
}