Browse Source

Do not tokenize empty input.

tags/0.8.0
Vsevolod Stakhov 9 years ago
parent
commit
cc36c9e94b
2 changed files with 8 additions and 1 deletions
  1. 4
    1
      src/libmime/filter.c
  2. 4
    0
      src/tokenizers/osb.c

+ 4
- 1
src/libmime/filter.c View File

@@ -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 */

+ 4
- 0
src/tokenizers/osb.c View File

@@ -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,

Loading…
Cancel
Save