]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
* Do not compare empty parts
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 20 Jul 2010 16:38:36 +0000 (20:38 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 20 Jul 2010 16:38:36 +0000 (20:38 +0400)
src/expressions.c

index b377fa0baa6fb1c96a6861e82dd60dc4014ae685..b4615c927a7e617feacdc7ad7f43986955734704 100644 (file)
@@ -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 {