aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-20 17:23:01 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-12-20 17:23:01 +0000
commita1d22e97dfbe18eb0c71c064c446af8822c2c88c (patch)
tree6b1f9cf260782e356d47d30121731269ad60c8bb
parentdc575a6374f4de6af8fd2ab98ef2e3690db3148d (diff)
downloadrspamd-a1d22e97dfbe18eb0c71c064c446af8822c2c88c.tar.gz
rspamd-a1d22e97dfbe18eb0c71c064c446af8822c2c88c.zip
[Minor] Fix crash on messages with no subject
-rw-r--r--src/libmime/message.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index a9dbdb245..4b2330ed2 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -700,8 +700,11 @@ rspamd_message_parse (struct rspamd_task *task)
if (!task->subject) {
hdrs = rspamd_message_get_header_array (task, "Subject", FALSE);
- rh = g_ptr_array_index (hdrs, 0);
- task->subject = rh->decoded;
+
+ if (hdrs) {
+ rh = g_ptr_array_index (hdrs, 0);
+ task->subject = rh->decoded;
+ }
}
debug_task ("found %ud parts in message", task->parts->len);