summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-12 15:17:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-12 15:18:17 +0100
commit0a2eb9a433a41667b01863b61da4df42b3e48dec (patch)
tree0e78c0ad576d0cc3f76f760f9e4218d603b69cc2 /src
parent798a6cc321640f579c37dc400a9bca31cb8ad5e2 (diff)
downloadrspamd-0a2eb9a433a41667b01863b61da4df42b3e48dec.tar.gz
rspamd-0a2eb9a433a41667b01863b61da4df42b3e48dec.zip
[Project] Fix some final issues
Diffstat (limited to 'src')
-rw-r--r--src/libmime/message.c5
-rw-r--r--src/libmime/mime_headers.c12
2 files changed, 13 insertions, 4 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index a725d7e89..fb488b71b 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -1140,11 +1140,16 @@ rspamd_message_new (struct rspamd_task *task)
msg = rspamd_mempool_alloc0 (task->task_pool, sizeof (*msg));
msg->raw_headers = rspamd_message_headers_new ();
+
msg->emails = g_hash_table_new (rspamd_email_hash, rspamd_emails_cmp);
msg->urls = g_hash_table_new (rspamd_url_hash, rspamd_urls_cmp);
+
msg->parts = g_ptr_array_sized_new (4);
msg->text_parts = g_ptr_array_sized_new (2);
+ msg->from_mime = g_ptr_array_sized_new (1);
+ msg->rcpt_mime = g_ptr_array_sized_new (1);
+
REF_INIT_RETAIN (msg, rspamd_message_dtor);
return msg;
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c
index bc8ace679..f9027b53d 100644
--- a/src/libmime/mime_headers.c
+++ b/src/libmime/mime_headers.c
@@ -1602,13 +1602,17 @@ rspamd_message_get_header_from_hash (khash_t(rspamd_mime_headers_htb) *htb,
{
khiter_t k;
- k = kh_get (rspamd_mime_headers_htb, htb, (gchar *)field);
+ if (htb) {
+ k = kh_get (rspamd_mime_headers_htb, htb, (gchar *) field);
- if (k == kh_end (htb)) {
- return NULL;
+ if (k == kh_end (htb)) {
+ return NULL;
+ }
+
+ return kh_value (htb, k);
}
- return kh_value (htb, k);
+ return NULL;
}
struct rspamd_mime_header *