From: Vsevolod Stakhov Date: Thu, 23 Apr 2009 14:12:47 +0000 (+0400) Subject: * Threat message regexps as raw by default X-Git-Tag: 0.2.7~179 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cfcde690c18f3b0be754115d50d666857ff60309;p=rspamd.git * Threat message regexps as raw by default --- 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;