From c3678762318d546fae00a0aeb659c3c2c3d87fa7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 20 Jul 2010 20:38:36 +0400 Subject: * Do not compare empty parts --- src/expressions.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/expressions.c b/src/expressions.c index b377fa0ba..b4615c927 100644 --- a/src/expressions.c +++ b/src/expressions.c @@ -952,10 +952,12 @@ rspamd_parts_distance (struct worker_task * task, GList * args, void *unused) return FALSE; } p2 = cur->data; - diff = fuzzy_compare_hashes (p1->fuzzy, p2->fuzzy); - debug_task ("got likeliness between parts of %d%%, threshold is %d%%", diff, threshold); - if (diff <= threshold) { - return TRUE; + if (!p1->is_empty && !p2->is_empty) { + diff = fuzzy_compare_hashes (p1->fuzzy, p2->fuzzy); + debug_task ("got likeliness between parts of %d%%, threshold is %d%%", diff, threshold); + if (diff <= threshold) { + return TRUE; + } } } else { -- cgit v1.2.3