aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-24 13:57:27 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-03-24 13:57:27 +0300
commitcd4a2c85d9447adcb611930e443d94a1606c1b19 (patch)
tree29063855c13d06ae7434605db5c2b23a9aaff6f5
parent5497b1213a5ee69cd25bd8cce26d223e8277ee3a (diff)
downloadrspamd-cd4a2c85d9447adcb611930e443d94a1606c1b19.tar.gz
rspamd-cd4a2c85d9447adcb611930e443d94a1606c1b19.zip
* Fix expression optimizator
-rw-r--r--src/plugins/regexp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c
index b1f4b4f15..03080c010 100644
--- a/src/plugins/regexp.c
+++ b/src/plugins/regexp.c
@@ -277,6 +277,7 @@ optimize_regexp_expression (struct expression **e, GQueue *stack, gboolean res)
if (it->content.operation == '!') {
res = !res;
it = it->next;
+ *e = it;
continue;
}
else if (it->content.operation == '&' && res == FALSE) {
@@ -353,7 +354,9 @@ process_regexp_item (struct regexp_module_item *item, struct worker_task *task)
continue;
}
}
- it = it->next;
+ if (it) {
+ it = it->next;
+ }
}
if (!g_queue_is_empty (stack)) {
op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack));