diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-27 19:58:42 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2009-03-27 19:58:42 +0300 |
commit | 5d37c7aab50278a996a16390ef7a5ad65f799cd7 (patch) | |
tree | d389cad3648e6db779992448c3c0e34e8033e8e7 | |
parent | 7c2d28229775bf2aeb381618122296e362435986 (diff) | |
download | rspamd-5d37c7aab50278a996a16390ef7a5ad65f799cd7.tar.gz rspamd-5d37c7aab50278a996a16390ef7a5ad65f799cd7.zip |
* Fix error in parser when parsing last ')' we need to remove '(' from stack as well
-rw-r--r-- | src/expressions.c | 3 | ||||
-rw-r--r-- | test/rspamd_expression_test.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/expressions.c b/src/expressions.c index c1cd8c0bd..e706fc938 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -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 */ diff --git a/test/rspamd_expression_test.c b/test/rspamd_expression_test.c index 7b723e9e6..d49cb4ac1 100644 --- a/test/rspamd_expression_test.c +++ b/test/rspamd_expression_test.c @@ -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 }; |