]> source.dussan.org Git - rspamd.git/commitdiff
Fix processing of empty messages.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Jan 2016 20:48:14 +0000 (20:48 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Jan 2016 20:48:14 +0000 (20:48 +0000)
Issue: #486
Reported by: @moisseev

src/libmime/message.c
src/libutil/str_util.c

index f7b76640ab421036973ceb063f7eee26f954d331..854b9e5615bc11dc68150d5449156c4d29c3081f 100644 (file)
@@ -1357,7 +1357,7 @@ mime_foreach_callback (GMimeObject * part, gpointer user_data)
                mime_part->raw_headers = g_hash_table_new (rspamd_strcase_hash,
                                rspamd_strcase_equal);
                rspamd_mempool_add_destructor (task->task_pool,
-                               (rspamd_mempool_destruct_t) g_hash_table_destroy,
+                               (rspamd_mempool_destruct_t) g_hash_table_unref,
                                mime_part->raw_headers);
                if (hdrs != NULL) {
                        process_raw_headers (task, mime_part->raw_headers,
@@ -1423,7 +1423,7 @@ mime_foreach_callback (GMimeObject * part, gpointer user_data)
                                mime_part->raw_headers = g_hash_table_new (rspamd_strcase_hash,
                                                rspamd_strcase_equal);
                                rspamd_mempool_add_destructor (task->task_pool,
-                                       (rspamd_mempool_destruct_t) g_hash_table_destroy,
+                                       (rspamd_mempool_destruct_t) g_hash_table_unref,
                                        mime_part->raw_headers);
                                if (hdrs != NULL) {
                                        process_raw_headers (task, mime_part->raw_headers,
index 62d71dd2c9f03aaf0775dd638b0229517309d255..d8e2dab0c3799e55ef0e16a14ce9e98c0ae486d5 100644 (file)
@@ -1267,6 +1267,10 @@ rspamd_string_find_eoh (GString *input)
                }
        }
 
+       if (state == got_linebreak_lf) {
+               return c - input->str;
+       }
+
        return -1;
 }