diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-05-14 14:38:25 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-05-14 14:38:25 +0100 |
commit | ae9aabdc6573336f36086513fccc055b6536ea46 (patch) | |
tree | 53d3c647447bce51b8d007c2e76e57b582d442fa /src/lua | |
parent | 5103fd021c61b860cc2bf6e6872d1456819627c3 (diff) | |
download | rspamd-ae9aabdc6573336f36086513fccc055b6536ea46.tar.gz rspamd-ae9aabdc6573336f36086513fccc055b6536ea46.zip |
[Minor] Oops, fix table iteration
Diffstat (limited to 'src/lua')
-rw-r--r-- | src/lua/lua_config.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lua/lua_config.c b/src/lua/lua_config.c index b2333eab1..aee5e25ae 100644 --- a/src/lua/lua_config.c +++ b/src/lua/lua_config.c @@ -2082,8 +2082,8 @@ lua_config_register_symbol (lua_State * L) lua_gettable (L, 2); if (lua_type (L, -1) == LUA_TTABLE) { - - for (lua_pushnil (L); lua_next (L, 2); lua_pop (L, 1)) { + int tbl_idx = lua_gettop(L); + for (lua_pushnil(L); lua_next(L, tbl_idx); lua_pop (L, 1)) { rspamd_symcache_add_symbol_augmentation(cfg->cache, ret, lua_tostring(L, -1)); } @@ -2778,7 +2778,8 @@ lua_config_newindex (lua_State *L) if (lua_type (L, -1) == LUA_TTABLE) { - for (lua_pushnil(L); lua_next(L, 2); lua_pop (L, 1)) { + int tbl_idx = lua_gettop(L); + for (lua_pushnil(L); lua_next(L, tbl_idx); lua_pop (L, 1)) { rspamd_symcache_add_symbol_augmentation(cfg->cache, id, lua_tostring(L, -1)); } |