From ae24d391fb899234fefa49fa6a557e7c77a96522 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 25 Dec 2021 20:02:54 +0000 Subject: [PATCH] [Minor] Fix division by zero --- src/plugins/chartable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/chartable.c b/src/plugins/chartable.c index c997862a1..56fdac3a6 100644 --- a/src/plugins/chartable.c +++ b/src/plugins/chartable.c @@ -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; } -- 2.39.5