From: Vsevolod Stakhov Date: Wed, 11 Mar 2015 15:43:30 +0000 (+0000) Subject: Fix issue with raw regexp processing. X-Git-Tag: 0.9.0~519 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3a04ba27ee630246cdba7bb61ba3f7b0a5dd9980;p=thirdparty%2Frspamd.git Fix issue with raw regexp processing. --- diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 09725c7c73..b96fcca31c 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -503,13 +503,14 @@ process_regexp (struct rspamd_regexp_element *re, rh = cur->data; debug_task ("found header \"%s\" with value \"%s\"", re->header, rh->decoded); + regexp = re->regexp; + if (re->type == REGEXP_RAW_HEADER) { in = rh->value; raw = TRUE; } else { in = rh->decoded; - regexp = re->regexp; /* Validate input */ if (!in || !g_utf8_validate (in, -1, NULL)) { cur = g_list_next (cur); @@ -572,14 +573,13 @@ process_regexp (struct rspamd_regexp_element *re, cur = g_list_next (cur); continue; } + + regexp = re->regexp; + /* Check raw flags */ if (part->is_raw) { raw = TRUE; } - else { - /* This time there is no need to validate anything as conversion succeed only for valid characters */ - regexp = re->regexp; - } /* Select data for regexp */ if (raw) { ct = part->orig->data;