]> source.dussan.org Git - rspamd.git/commitdiff
* Fix error in parser when parsing last ')' we need to remove '(' from stack as well
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 27 Mar 2009 16:58:42 +0000 (19:58 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 27 Mar 2009 16:58:42 +0000 (19:58 +0300)
src/expressions.c
test/rspamd_expression_test.c

index c1cd8c0bdfec56f1cd3e4bf18ed1896aea683d09..e706fc9382f3400c0f27186f1506592cc544fd33 100644 (file)
@@ -277,6 +277,9 @@ parse_expression (memory_pool_t *pool, char *line)
                                                        insert_expression (pool, &expr, EXPR_OPERATION, op, NULL);
                                                }
                                        }
+                                       if (stack) {
+                                               op = delete_expression_stack (&stack);
+                                       }
                                }
                                else if (*p == '(') {
                                        /* Push it to stack */
index 7b723e9e6f7914d598d636d44021ad9a528ed911..d49cb4ac12b704c7de832b28b5a03b55f3bc6eea 100644 (file)
@@ -9,6 +9,7 @@ char *test_expressions[] = {
        "(A&B|!C)&!(D|E)",
        "/test&!/&!/\\/|/",
        "header_exists(f(b(aaa)))|header=/bbb/",
+       "!(header_exists(X-Mailer) | header_exists(User-Agent)) & Received=/cp-out\\d+\\.libero\\.it/H & Message-Id=/<[\\da-f]{12}\\.[\\da-f]{16}@/H",
        NULL
 };