diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-23 18:12:47 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-04-23 18:12:47 +0400 |
commit | cfcde690c18f3b0be754115d50d666857ff60309 (patch) | |
tree | 770c8692b43ef732eefab99e4b285c9f760b80d2 /src | |
parent | e956b46665a3176eeae4f8793f6e62ef73339c17 (diff) | |
download | rspamd-cfcde690c18f3b0be754115d50d666857ff60309.tar.gz rspamd-cfcde690c18f3b0be754115d50d666857ff60309.zip |
* Threat message regexps as raw by default
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/regexp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 340e09964..87d484ccf 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -221,7 +221,7 @@ process_regexp (struct rspamd_regexp *re, struct worker_task *task) return 0; case REGEXP_MESSAGE: msg_debug ("process_regexp: checking message regexp: /%s/", re->regexp_text); - if (g_regex_match_full (re->regexp, task->msg->begin, task->msg->len, 0, 0, NULL, NULL) == TRUE) { + if (g_regex_match_full (re->raw_regexp, task->msg->begin, task->msg->len, 0, 0, NULL, NULL) == TRUE) { task_cache_add (task, re, 1); return 1; } @@ -358,7 +358,11 @@ process_regexp_expression (struct expression *expr, struct worker_task *task) } } else if (it->type == EXPR_REGEXP) { /* Compile regexp if it is not parsed */ - it->content.operand = parse_regexp (task->task_pool, it->content.operand, task->cfg->raw_mode); + if (it->content.operand == NULL) { + it = it->next; + continue; + } + it->content.operand = parse_regexp (task->cfg->cfg_pool, it->content.operand, task->cfg->raw_mode); if (it->content.operand == NULL) { msg_warn ("process_regexp_expression: cannot parse regexp, skip expression"); return FALSE; |