From: Vsevolod Stakhov Date: Mon, 27 Apr 2009 16:04:08 +0000 (+0400) Subject: * Fix stupid error in case structure. X-Git-Tag: 0.2.7~167 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4152d7b61f2c304eb151bee7a45e5cf87d7428aa;p=rspamd.git * Fix stupid error in case structure. --- diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index d21baf494..a647df62d 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -433,6 +433,7 @@ process_regexp_expression (struct expression *expr, struct worker_task *task) } else if (it->type == EXPR_OPERATION) { if (g_queue_is_empty (stack)) { /* Queue has no operands for operation, exiting */ + msg_warn ("process_regexp_expression: regexp expression seems to be invalid: empty stack while reading operation"); g_queue_free (stack); return FALSE; } @@ -446,10 +447,12 @@ process_regexp_expression (struct expression *expr, struct worker_task *task) op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack)); op2 = GPOINTER_TO_SIZE (g_queue_pop_head (stack)); g_queue_push_head (stack, GSIZE_TO_POINTER (op1 && op2)); + break; case '|': op1 = GPOINTER_TO_SIZE (g_queue_pop_head (stack)); op2 = GPOINTER_TO_SIZE (g_queue_pop_head (stack)); g_queue_push_head (stack, GSIZE_TO_POINTER (op1 || op2)); + break; default: it = it->next; continue; @@ -465,6 +468,9 @@ process_regexp_expression (struct expression *expr, struct worker_task *task) return TRUE; } } + else { + msg_warn ("process_regexp_expression: regexp expression seems to be invalid: empty stack at the end of expression"); + } g_queue_free (stack);