From 41ff84dc2fff1780ccff570eef044bc6b7136af5 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 30 Nov 2016 13:34:41 +0000 Subject: [PATCH] [Fix] Fix crashes with invalid received and task:set_from_ip --- src/libmime/message.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libmime/message.c b/src/libmime/message.c index d9296964b..413f2955c 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1625,7 +1625,10 @@ rspamd_message_parse (struct rspamd_task *task) trecv->real_ip = rspamd_mempool_strdup (task->task_pool, rspamd_inet_address_to_string (task->from_addr)); trecv->from_ip = trecv->real_ip; - trecv->addr = task->from_addr; + trecv->addr = rspamd_inet_address_copy (task->from_addr); + rspamd_mempool_add_destructor (task->task_pool, + (rspamd_mempool_destruct_t)rspamd_inet_address_destroy, + trecv->addr); if (task->hostname) { trecv->real_hostname = task->hostname; -- 2.39.5