aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-26 13:54:01 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-26 13:54:01 +0000
commitf49870c17049808938ffab9391bcd13bf0a6d098 (patch)
tree09a7cf079925b4d4bd742b3976918a0265f208c4 /src
parent9669a7da2324e1fbf96c8731711f29b2d85a1f16 (diff)
downloadrspamd-f49870c17049808938ffab9391bcd13bf0a6d098.tar.gz
rspamd-f49870c17049808938ffab9391bcd13bf0a6d098.zip
Fix composites processing.
Diffstat (limited to 'src')
-rw-r--r--src/libmime/filter.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c
index 00cd7396e..43e8e1b2d 100644
--- a/src/libmime/filter.c
+++ b/src/libmime/filter.c
@@ -445,7 +445,8 @@ rspamd_composite_expr_parse (const gchar *line, gsize len,
res = rspamd_mempool_alloc0 (pool, sizeof (*res));
res->len = clen;
res->str = line;
- res->data = rspamd_mempool_strdup (pool, line);
+ res->data = rspamd_mempool_alloc (pool, clen + 1);
+ rspamd_strlcpy (res->data, line, clen + 1);
return res;
}
@@ -453,7 +454,7 @@ static gint
rspamd_composite_expr_process (gpointer input, rspamd_expression_atom_t *atom)
{
struct composites_data *cd = (struct composites_data *)input;
- const gchar *sym = atom->str;
+ const gchar *sym = atom->data;
struct rspamd_composite *ncomp;
struct symbol_remove_data *rd;
struct symbol *ms;
@@ -560,9 +561,11 @@ composites_foreach_callback (gpointer key, gpointer value, void *data)
/* Checked bit */
setbit (cd->checked, comp->id * 2);
+
/* Result bit */
if (rc) {
setbit (cd->checked, comp->id * 2 + 1);
+ rspamd_task_insert_result_single (cd->task, key, 1.0, NULL);
}
else {
clrbit (cd->checked, comp->id * 2 + 1);