From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Tue, 6 Dec 2011 14:18:20 +0100 Subject: [PATCH] debug.getfenv does not check whether it has an argument. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Comes from http://www.lua.org/bugs.html#5.1.4-5 reported by Patrick Donnelly on 30 Jul 2009. Example: -- debug.getfenv() -- should raise an error -- Signed-off-by: BenoƮt Burnichon --- src/ldblib.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/ldblib.c b/src/ldblib.c index 67de122..21116ac 100644 --- a/src/ldblib.c +++ b/src/ldblib.c @@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) { static int db_getfenv (lua_State *L) { + luaL_checkany(L, 1); lua_getfenv(L, 1); return 1; }