]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Another fail-safety check
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 27 Nov 2018 11:41:20 +0000 (11:41 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 27 Nov 2018 11:41:20 +0000 (11:41 +0000)
src/libmime/lang_detection.c

index a8ad1d57c99676a89ccaf4edb9dfcea9cf8bd98d..b4e147fdab38bddeeaae2b4a5c1a9cf4828bdfa5 100644 (file)
@@ -1187,8 +1187,11 @@ rspamd_language_detector_detect_type (struct rspamd_task *task,
        for (i = 0; i < nparts; i++) {
                tok = &g_array_index (words, rspamd_stat_token_t,
                                selected_words[i]);
-               rspamd_language_detector_detect_word (task, d, tok, candidates,
-                               d->trigramms[cat]);
+
+               if (tok->unicode.len >= 3) {
+                       rspamd_language_detector_detect_word (task, d, tok, candidates,
+                                       d->trigramms[cat]);
+               }
        }
 
        /* Filter negligible candidates */