]> source.dussan.org Git - rspamd.git/commitdiff
Fix issue with raw regexp processing.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Mar 2015 15:43:30 +0000 (15:43 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 11 Mar 2015 15:43:30 +0000 (15:43 +0000)
src/plugins/regexp.c

index 09725c7c73a287083fdee90018e14278f1316710..b96fcca31c546c17dc0271710c6d31a47592c0ad 100644 (file)
@@ -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;