diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-30 13:44:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2014-12-30 13:44:57 +0000 |
commit | cc36c9e94b102d12a0a40f37fd0d996c3988d48a (patch) | |
tree | 61ff6d890cec125769ec0fc46839d94cc38d47cb /src | |
parent | e6d7ea3b6b52a6b77154d5b508b2555c11439580 (diff) | |
download | rspamd-cc36c9e94b102d12a0a40f37fd0d996c3988d48a.tar.gz rspamd-cc36c9e94b102d12a0a40f37fd0d996c3988d48a.zip |
Do not tokenize empty input.
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/filter.c | 5 | ||||
-rw-r--r-- | src/tokenizers/osb.c | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/libmime/filter.c b/src/libmime/filter.c index 467f30b9c..a1f042aae 100644 --- a/src/libmime/filter.c +++ b/src/libmime/filter.c @@ -801,7 +801,10 @@ classifiers_callback (gpointer value, void *arg) } cur = g_list_next (cur); } - g_hash_table_insert (task->tokens, cl->tokenizer, tokens); + + if (tokens != NULL) { + g_hash_table_insert (task->tokens, cl->tokenizer, tokens); + } } /* Take care of subject */ diff --git a/src/tokenizers/osb.c b/src/tokenizers/osb.c index b879237c4..9dd12a8dd 100644 --- a/src/tokenizers/osb.c +++ b/src/tokenizers/osb.c @@ -49,6 +49,10 @@ osb_tokenize_text (struct tokenizer *tokenizer, gint i, processed = 0; guint w; + if (input == NULL) { + return FALSE; + } + if (*tree == NULL) { *tree = g_tree_new (token_node_compare_func); rspamd_mempool_add_destructor (pool, |