commit ae24d39: [Minor] Fix division by zero
Vsevolod Stakhov
vsevolod at highsecure.ru
Sat Dec 25 20:35:04 UTC 2021
Author: Vsevolod Stakhov
Date: 2021-12-25 20:02:54 +0000
URL: https://github.com/rspamd/rspamd/commit/ae24d391fb899234fefa49fa6a557e7c77a96522
[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;
}
More information about the Commits
mailing list