diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-30 13:34:41 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-11-30 13:35:02 +0000 |
commit | 41ff84dc2fff1780ccff570eef044bc6b7136af5 (patch) | |
tree | 102e95a5e28df015b673456e92b4800ab91f6bf7 | |
parent | 3fc259e9b6dad6c8787115b76184ba4440476127 (diff) | |
download | rspamd-41ff84dc2fff1780ccff570eef044bc6b7136af5.tar.gz rspamd-41ff84dc2fff1780ccff570eef044bc6b7136af5.zip |
[Fix] Fix crashes with invalid received and task:set_from_ip
-rw-r--r-- | src/libmime/message.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |