summaryrefslogtreecommitdiffstats
path: root/src/libutil/expression.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-17 23:29:27 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-17 23:29:49 +0000
commit29a5425adb186ac73ec2b7b436cb9e87be762adb (patch)
tree110aefcee0fcb10b8c8bf6d4dd18b353d3b8c98d /src/libutil/expression.c
parenta6e30390f384a5dd6446542436d45fd983af565b (diff)
downloadrspamd-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.c6
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)) {