aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-27 11:41:20 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-27 11:41:20 +0000
commitff2894404eadc85f19cdff4e71ac6d96eddb839b (patch)
tree3e1eeb37f0b9f576e9eaddbb7b1eb7c62f55f6ea
parentd5c7760ec8cd2eba3996b340c11bf13e9eb0e3cb (diff)
downloadrspamd-ff2894404eadc85f19cdff4e71ac6d96eddb839b.tar.gz
rspamd-ff2894404eadc85f19cdff4e71ac6d96eddb839b.zip
[Minor] Another fail-safety check
-rw-r--r--src/libmime/lang_detection.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libmime/lang_detection.c b/src/libmime/lang_detection.c
index a8ad1d57c..b4e147fda 100644
--- a/src/libmime/lang_detection.c
+++ b/src/libmime/lang_detection.c
@@ -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 */