From ba66d6a5bb73f10515484315c6b676603cd0edf1 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 6 Aug 2020 12:05:43 +0100 Subject: [PATCH] [Fix] Fix lua_next invocation --- src/plugins/fuzzy_check.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c index d0faaed953..6a2ad3e072 100644 --- a/src/plugins/fuzzy_check.c +++ b/src/plugins/fuzzy_check.c @@ -2945,8 +2945,10 @@ fuzzy_generate_commands (struct rspamd_task *task, struct fuzzy_rule *rule, lua_gettable (L, -2); if (lua_type (L, -1) == LUA_TTABLE) { + gint tbl_pos = lua_gettop (L); - for (lua_pushnil (L); lua_next (L, 2); lua_pop (L, 1)) { + for (lua_pushnil (L); lua_next (L, tbl_pos); + lua_pop (L, 1)) { const gchar *h = NULL; gsize hlen = 0; -- 2.47.3