aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-26 13:37:38 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-26 13:37:38 +0000
commit776405e98494e51e8dba7b2eb10bf44088c0101c (patch)
tree5fac7c12e76b29283620f0919be6fa544381268b
parente180ef2ce601b4118dab29ab074712c0a58244e4 (diff)
downloadrspamd-776405e98494e51e8dba7b2eb10bf44088c0101c.tar.gz
rspamd-776405e98494e51e8dba7b2eb10bf44088c0101c.zip
[Minor] Check language detector pointer before use
-rw-r--r--src/libstat/tokenizers/tokenizers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstat/tokenizers/tokenizers.c b/src/libstat/tokenizers/tokenizers.c
index 9ec0c4315..604fc070e 100644
--- a/src/libstat/tokenizers/tokenizers.c
+++ b/src/libstat/tokenizers/tokenizers.c
@@ -771,8 +771,8 @@ rspamd_stem_words (GArray *words, rspamd_mempool_t *pool,
tok->stemmed.begin = tok->normalized.begin;
}
- if (tok->stemmed.len > 0 && rspamd_language_detector_is_stop_word (d,
- tok->stemmed.begin, tok->stemmed.len)) {
+ if (tok->stemmed.len > 0 && d != NULL &&
+ rspamd_language_detector_is_stop_word (d, tok->stemmed.begin, tok->stemmed.len)) {
tok->flags |= RSPAMD_STAT_TOKEN_FLAG_STOP_WORD;
}
}