diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-20 20:38:36 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2010-07-20 20:38:36 +0400 |
commit | c3678762318d546fae00a0aeb659c3c2c3d87fa7 (patch) | |
tree | 8a80129042ba87368c709fb93d548facd5575556 /src | |
parent | a4bce00dc4be27f4418f45c324362d30a6023469 (diff) | |
download | rspamd-c3678762318d546fae00a0aeb659c3c2c3d87fa7.tar.gz rspamd-c3678762318d546fae00a0aeb659c3c2c3d87fa7.zip |
* Do not compare empty parts
Diffstat (limited to 'src')
-rw-r--r-- | src/expressions.c | 10 |
1 files changed, 6 insertions, 4 deletions
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 { |