From: Vsevolod Stakhov Date: Tue, 24 Mar 2009 10:57:27 +0000 (+0300) Subject: * Fix expression optimizator X-Git-Tag: 0.2.7~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd4a2c85d9447adcb611930e443d94a1606c1b19;p=thirdparty%2Frspamd.git * Fix expression optimizator --- diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index b1f4b4f15e..03080c0103 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));