From decada8dc2e6ae9c95e4dd3fe3a12762535f95cc Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 4 Aug 2009 15:51:19 -0300 Subject: [PATCH] 'debug.getfenv' does not check whether it has an argument --- bugs | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/bugs b/bugs index de8001cf..04229cb4 100644 --- a/bugs +++ b/bugs @@ -1880,8 +1880,8 @@ patch = [[ +++ lundump.c 2008/04/04 19:51:41 2.7.1.4 @@ -1,5 +1,5 @@ /* --** $Id: bugs,v 1.101 2009/07/01 21:10:33 roberto Exp roberto $ -+** $Id: bugs,v 1.101 2009/07/01 21:10:33 roberto Exp roberto $ +-** $Id: bugs,v 1.102 2009/07/02 19:57:34 roberto Exp roberto $ ++** $Id: bugs,v 1.102 2009/07/02 19:57:34 roberto Exp roberto $ ** load precompiled Lua chunks ** See Copyright Notice in lua.h */ @@ -2212,4 +2212,23 @@ too many values in its stack and confuse its stack indices. patch = [[ ]], } + +But{ +what = [['debug.getfenv' does not check whether it has an argument]], +report = [[Patrick Donnelly, 2009/07/30]], +since = [[5.1]], +example = [[debug.getfenv() -- should raise an error]], +patch = [[ +--- ldblib.c 2008/01/21 13:11:21 1.104.1.3 ++++ ldblib.c 2009/08/04 18:43:12 +@@ -45,6 +45,7 @@ + + + static int db_getfenv (lua_State *L) { ++ luaL_checkany(L, 1); + lua_getfenv(L, 1); + return 1; + } +]], } +