]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix division by zero
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 25 Dec 2021 20:02:54 +0000 (20:02 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 25 Dec 2021 20:33:55 +0000 (20:33 +0000)
src/plugins/chartable.c

index c997862a14a53ba4f39c576d46234f2e211a6f50..56fdac3a63804c242c51acc9880cefa18cf024af 100644 (file)
@@ -596,7 +596,7 @@ rspamd_chartable_process_part (struct rspamd_task *task,
        gdouble cur_score = 0.0;
 
        if (part == NULL || part->utf_words == NULL ||
-                       part->utf_words->len == 0) {
+                       part->utf_words->len == 0 || part->nwords == 0) {
                return FALSE;
        }