Use after free in 'luaV_finishset'
If a metatable is a weak table, its __newindex field could be collected by an emergency collection while being used in 'luaV_finishset'. (This bug has similarities with bug 5.3.2-1, fixed in commit a272fa66.)
This commit is contained in:
5
lapi.c
5
lapi.c
@@ -681,6 +681,11 @@ static int auxgetstr (lua_State *L, const TValue *t, const char *k) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** The following function assumes that the registry cannot be a weak
|
||||
** table, so that en mergency collection while using the global table
|
||||
** cannot collect it.
|
||||
*/
|
||||
static void getGlobalTable (lua_State *L, TValue *gt) {
|
||||
Table *registry = hvalue(&G(L)->l_registry);
|
||||
lu_byte tag = luaH_getint(registry, LUA_RIDX_GLOBALS, gt);
|
||||
|
||||
Reference in New Issue
Block a user