commit fd8ce41: [Minor] Allow to work with non-registered symbols

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Feb 25 15:35:15 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-02-25 15:31:55 +0000
URL: https://github.com/rspamd/rspamd/commit/fd8ce41febd0308b22b46f41fa67f6bf1ed23bda (HEAD -> master)

[Minor] Allow to work with non-registered symbols

---
 src/lua/lua_task.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index d5a1cd59e..82556279b 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -4774,9 +4774,10 @@ lua_task_process_ann_tokens (lua_State *L)
 			sres = rspamd_task_find_symbol_result (task, sym);
 
 			if (sres && !(sres->flags & RSPAMD_SYMBOL_RESULT_IGNORED)) {
+
 				if (!isnan (sres->score) && !isinf (sres->score) &&
-					!(rspamd_symcache_item_flags (sres->sym->cache_item) &
-					  SYMBOL_TYPE_NOSTAT)) {
+						(!sres->sym ||
+							!(rspamd_symcache_item_flags (sres->sym->cache_item) & SYMBOL_TYPE_NOSTAT))) {
 
 					lua_pushnumber (L, fabs (tanh (sres->score)));
 					lua_rawseti (L, 3, offset + 1);


More information about the Commits mailing list