]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Do not crash if symbol is missing in the metric
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 11 Jul 2024 15:23:33 +0000 (16:23 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 11 Jul 2024 15:23:33 +0000 (16:23 +0100)
src/lua/lua_task.c

index 61aac63f25ce854820024c7e3e8d160b9204473c..21e24fc4589dfb8210e0be1424aa681fe88ddab2 100644 (file)
@@ -4716,7 +4716,7 @@ lua_push_symbol_result(lua_State *L,
                lua_settable(L, -3);
 
                /* Dynamic weight of the symbol */
-               if (s->sym->score != 0) {
+               if (s->sym != NULL && s->sym->score != 0) {
                        lua_pushstring(L, "weight");
                        lua_pushnumber(L, s->score / s->sym->score);
                }