]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix crash on messages with no subject
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Dec 2016 17:23:01 +0000 (17:23 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Dec 2016 17:23:01 +0000 (17:23 +0000)
src/libmime/message.c

index a9dbdb245a38b60b756e3baa48bef32f86faef45..4b2330ed22ecdc1c509a79ca7d5d5345a533d7b3 100644 (file)
@@ -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);