]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] Fix lua_next invocation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 Aug 2020 11:05:43 +0000 (12:05 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 6 Aug 2020 11:06:46 +0000 (12:06 +0100)
src/plugins/fuzzy_check.c

index d0faaed953bc09a8984f731eadd896df6c2811ef..6a2ad3e072a0010a0b2e63f9bc17cf9757dd70ef 100644 (file)
@@ -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;