diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-17 23:29:27 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-17 23:29:49 +0000 |
commit | 29a5425adb186ac73ec2b7b436cb9e87be762adb (patch) | |
tree | 110aefcee0fcb10b8c8bf6d4dd18b353d3b8c98d /src/libutil/expression.c | |
parent | a6e30390f384a5dd6446542436d45fd983af565b (diff) | |
download | rspamd-29a5425adb186ac73ec2b7b436cb9e87be762adb.tar.gz rspamd-29a5425adb186ac73ec2b7b436cb9e87be762adb.zip |
Fix more issues in expressions parser.
Diffstat (limited to 'src/libutil/expression.c')
-rw-r--r-- | src/libutil/expression.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c index 2cd1fe53f..3ae7ed469 100644 --- a/src/libutil/expression.c +++ b/src/libutil/expression.c @@ -184,6 +184,9 @@ rspamd_expr_str_to_op (const gchar *a, const gchar *end, const gchar **next) *next = a + 1; } } + else { + *next = end; + } /* XXX: not especially effective */ switch (*a) { case '!': @@ -336,7 +339,7 @@ rspamd_parse_expression (const gchar *line, gsize len, state = SKIP_SPACES; } else if (rspamd_expr_is_operation_symbol (*p)) { - state = PARSE_ATOM; + state = PARSE_OP; } else { /* @@ -480,6 +483,7 @@ rspamd_parse_expression (const gchar *line, gsize len, rspamd_expr_stack_push (e, GINT_TO_POINTER (op)); } + state = SKIP_SPACES; break; case SKIP_SPACES: if (g_ascii_isspace (*p)) { |