summaryrefslogtreecommitdiffstats
path: root/src/plugins/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2009-04-27 20:04:08 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2009-04-27 20:04:08 +0400
commit4152d7b61f2c304eb151bee7a45e5cf87d7428aa (patch)
treefda2a9dc8291a94786ad7e8adce3db2b844197e6 /src/plugins/regexp.c
parent8c54357fbb1d7a4ac249563615f270bccd4ab891 (diff)
downloadrspamd-4152d7b61f2c304eb151bee7a45e5cf87d7428aa.tar.gz
rspamd-4152d7b61f2c304eb151bee7a45e5cf87d7428aa.zip
* Fix stupid error in case structure.
Diffstat (limited to 'src/plugins/regexp.c')
-rw-r--r--src/plugins/regexp.c6
1 files changed, 6 insertions, 0 deletions
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);