aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-22 15:47:21 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-07-22 15:47:21 +0100
commit23084e297df504c84fcb07c951246473cbab9293 (patch)
tree543f504242607b961b82f7f374dfc3a15280d46b /src/plugins
parentccf98c926f2ac03f8c117182f1db613de151c437 (diff)
downloadrspamd-23084e297df504c84fcb07c951246473cbab9293.tar.gz
rspamd-23084e297df504c84fcb07c951246473cbab9293.zip
[Minor] Fix another fuzzy stat issue
Issue: #2989
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/fuzzy_check.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index a72dfbbb0..385c16b71 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -2139,18 +2139,21 @@ fuzzy_insert_metric_results (struct rspamd_task *task, GPtrArray *results)
}
}
- PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, text_parts), i, tp) {
- if (!IS_PART_EMPTY (tp)) {
- seen_text = TRUE;
- }
- else if (tp->utf_stripped_text.magic == UTEXT_MAGIC) {
- if (utext_isLengthExpensive (&tp->utf_stripped_text)) {
- seen_long_text =
- utext_nativeLength (&tp->utf_stripped_text) > text_length_cutoff;
+ if (task->message) {
+ PTR_ARRAY_FOREACH (MESSAGE_FIELD (task, text_parts), i, tp) {
+ if (!IS_PART_EMPTY (tp)) {
+ seen_text = TRUE;
}
- else {
- /* Cannot directly calculate length */
- seen_long_text = tp->utf_stripped_content->len / 2 > text_length_cutoff;
+ else if (tp->utf_stripped_text.magic == UTEXT_MAGIC) {
+ if (utext_isLengthExpensive (&tp->utf_stripped_text)) {
+ seen_long_text =
+ utext_nativeLength (&tp->utf_stripped_text) > text_length_cutoff;
+ }
+ else {
+ /* Cannot directly calculate length */
+ seen_long_text =
+ tp->utf_stripped_content->len / 2 > text_length_cutoff;
+ }
}
}
}