From abcc124df05fe19470abdb9d665160a7e3b01495 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 28 Nov 2007 16:27:38 -0200 Subject: BUG: lua_setfenv may crash if called over an invalid object --- bugs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'bugs') diff --git a/bugs b/bugs index ed2eb666..fe6b2b81 100644 --- a/bugs +++ b/bugs @@ -1594,6 +1594,27 @@ ltablib.c: ]], } +Bug{ +what = [[lua_setfenv may crash if called over an invalid object]], +report = [[Mike Pall, on 11/2007]], +since = [[5.1]], +example = [[ +> debug.setfenv(3, {}) +]], +patch = [[ +lapi.c: +@@ -749,7 +749,7 @@ + res = 0; + break; + } +- luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); ++ if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); + L->top--; + lua_unlock(L); + return res; +]], +} + Bug{ what = [[ ]], report = [[ , on ]], -- cgit v1.2.3-55-g6feb