lua/lua-5.4.3-CVE-2021-44647.patch

12 lines
650 B
Diff

diff -up lua-5.4.3/src/lstate.c.CVE-2021-44647 lua-5.4.3/src/lstate.c
--- lua-5.4.3/src/lstate.c.CVE-2021-44647 2022-01-24 11:15:00.851544455 -0500
+++ lua-5.4.3/src/lstate.c 2022-01-24 11:15:27.187694727 -0500
@@ -271,6 +271,7 @@ static void close_state (lua_State *L) {
if (!completestate(g)) /* closing a partially built state? */
luaC_freeallobjects(L); /* jucst collect its objects */
else { /* closing a fully built state */
+ L->ci = &L->base_ci; /* unwind CallInfo list */
luaD_closeprotected(L, 1, LUA_OK); /* close all upvalues */
luaC_freeallobjects(L); /* collect all objects */
luai_userstateclose(L);