From b529aefc531276775f8827052d5594749232cf07 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 12 Jun 2024 16:02:01 -0300 Subject: Bug: luaL_traceback may need more than 5 stack slots --- lauxlib.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index d742fd27..5f8e8f42 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -80,6 +80,7 @@ static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { int top = lua_gettop(L); lua_getinfo(L, "f", ar); /* push function */ lua_getfield(L, LUA_REGISTRYINDEX, LUA_LOADED_TABLE); + luaL_checkstack(L, 6, "not enough stack"); /* slots for 'findfield' */ if (findfield(L, top + 1, 2)) { const char *name = lua_tostring(L, -1); if (strncmp(name, LUA_GNAME ".", 3) == 0) { /* name start with '_G.'? */ -- cgit v1.2.3-55-g6feb