]> source.dussan.org Git - rspamd.git/commitdiff
* Fix expression optimizator
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 24 Mar 2009 10:57:27 +0000 (13:57 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 24 Mar 2009 10:57:27 +0000 (13:57 +0300)
src/plugins/regexp.c

index b1f4b4f15e638509e982bbf66850efbffbf7609d..03080c010351141c19f3db92d04a2336c7b897f4 100644 (file)
@@ -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));