]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: dlua_check_event() - Fix calling with negative arg
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Aug 2024 14:20:30 +0000 (17:20 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 22 Aug 2024 14:20:30 +0000 (17:20 +0300)
src/lib-lua/dlua-dovecot.c

index 5f23de151bf8dca36d843a7178e1e03b6e6c1956..df382ddd305a8a3067c530e406a0e8f6a70ee723 100644 (file)
@@ -258,6 +258,8 @@ struct event *dlua_check_event(lua_State *L, int arg)
                                 lua_typename(L, lua_type(L, arg)));
        }
        lua_pushliteral(L, "item");
+       if (arg < 0)
+               arg--;
        lua_rawget(L, arg);
        struct event **bp = (void*)lua_touserdata(L, -1);
        lua_pop(L, 1);