aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-18 14:59:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-08-18 14:59:46 +0100
commit3f4624d24b2814242415e7cd87f94fb505b897aa (patch)
tree397b9f1098ab342a45c978418ee4c6cdb6066610
parent6200c007ae89c33be65e5d3d61b443b5d58eddec (diff)
downloadrspamd-3f4624d24b2814242415e7cd87f94fb505b897aa.tar.gz
rspamd-3f4624d24b2814242415e7cd87f94fb505b897aa.zip
Fix critical bug in recipients_distance function.
-rw-r--r--src/libmime/expressions.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libmime/expressions.c b/src/libmime/expressions.c
index cce1209aa..0289daa57 100644
--- a/src/libmime/expressions.c
+++ b/src/libmime/expressions.c
@@ -1259,10 +1259,10 @@ rspamd_recipients_distance (struct rspamd_task *task, GList * args,
return FALSE;
}
- if (!task->rcpts) {
+ if (!task->rcpt_mime) {
return FALSE;
}
- num = internet_address_list_length (task->rcpts);
+ num = internet_address_list_length (task->rcpt_mime);
if (num < MIN_RCPT_TO_COMPARE) {
return FALSE;
}
@@ -1271,14 +1271,13 @@ rspamd_recipients_distance (struct rspamd_task *task, GList * args,
sizeof (struct addr_list));
/* Fill array */
- cur = task->rcpts;
+ cur = task->rcpt_mime;
#ifdef GMIME24
for (i = 0; i < num; i++) {
addr = internet_address_list_get_address (cur, i);
- ar[i].name = rspamd_mempool_strdup (task->task_pool,
- internet_address_get_name (addr));
+ ar[i].name = internet_address_mailbox_get_addr (
+ INTERNET_ADDRESS_MAILBOX (addr));
if (ar[i].name != NULL && (c = strchr (ar[i].name, '@')) != NULL) {
- *c = '\0';
ar[i].addr = c + 1;
}
}