From: Vsevolod Stakhov Date: Thu, 30 Jul 2009 13:39:10 +0000 (+0400) Subject: * Fix some more bugs with empty parts X-Git-Tag: 0.2.7~59 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=17b59dcc033cf8627a057b76b4cfc2735d9d1c82;p=rspamd.git * Fix some more bugs with empty parts --- diff --git a/src/message.c b/src/message.c index 643ac1710..c4027ef14 100644 --- a/src/message.c +++ b/src/message.c @@ -653,7 +653,7 @@ mime_foreach_callback (GMimeObject *part, gpointer user_data) msg_debug ("mime_foreach_callback: found part with content-type: %s/%s", type->type, type->subtype); task->parts = g_list_prepend (task->parts, mime_part); /* Skip empty parts */ - process_text_part (task, part_content, type, (part_content->len > 0)); + process_text_part (task, part_content, type, (part_content->len <= 0)); } else { msg_warn ("mime_foreach_callback: write to stream failed: %d, %s", errno, strerror (errno)); diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 45f07f9e7..3613b3f62 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -512,7 +512,7 @@ optimize_regexp_expression (struct expression **e, GQueue *stack, gboolean res) } static gboolean -process_regexp_expression (struct expression *expr, struct worker_task *task) +process_regexp_expression (struct expression *expr, char *symbol, struct worker_task *task) { GQueue *stack; gsize cur, op1, op2; @@ -598,7 +598,7 @@ process_regexp_expression (struct expression *expr, struct worker_task *task) } } else { - msg_warn ("process_regexp_expression: regexp expression seems to be invalid: empty stack at the end of expression"); + msg_warn ("process_regexp_expression: regexp expression seems to be invalid: empty stack at the end of expression, symbol %s", symbol); } g_queue_free (stack); @@ -611,7 +611,7 @@ process_regexp_item (struct worker_task *task, void *user_data) { struct regexp_module_item *item = user_data; - if (process_regexp_expression (item->expr, task)) { + if (process_regexp_expression (item->expr, item->symbol, task)) { insert_result (task, regexp_module_ctx->metric, item->symbol, 1, NULL); } } @@ -647,7 +647,7 @@ rspamd_regexp_match_number (struct worker_task *task, GList *args) } } else { - if (process_regexp_expression (cur->data, task)) { + if (process_regexp_expression (cur->data, "regexp_match_number", task)) { res ++; } if (res >= param_count) {