]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix crashes with invalid received and task:set_from_ip
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 30 Nov 2016 13:34:41 +0000 (13:34 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 30 Nov 2016 13:35:02 +0000 (13:35 +0000)
src/libmime/message.c

index d9296964be9f3f9fd48a9f244a54af82cbe00b34..413f2955ceecbbd6352fedad62f78d19b61846d1 100644 (file)
@@ -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;