aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRyan Moeller <freqlabs@FreeBSD.org>2021-02-25 05:16:52 +0000
committerRyan Moeller <freqlabs@FreeBSD.org>2021-03-14 08:09:20 +0000
commit4e535a1ba72e1f751f9cf869ab8c9d06514d6c59 (patch)
tree54b0d0712505daf4e9f475ba21e8710e5d378b5c /lib
parent137544502b0511eef36e2dc78a563d8d803cd2da (diff)
downloadsrc-4e535a1ba72e1f751f9cf869ab8c9d06514d6c59.tar.gz
src-4e535a1ba72e1f751f9cf869ab8c9d06514d6c59.zip
lib/flua/libjail: Allow empty params table
The name or jid always gets added to the params, and that's enough to avoid allocating a 0 length params array. Reported by: kevans Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D28778 (cherry picked from commit e175b519a6fb83889fb3ca679b73d11ea5bea7ad)
Diffstat (limited to 'lib')
-rw-r--r--lib/flua/libjail/lua_jail.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/lib/flua/libjail/lua_jail.c b/lib/flua/libjail/lua_jail.c
index 9981fd5421c6..b66c60b43bc8 100644
--- a/lib/flua/libjail/lua_jail.c
+++ b/lib/flua/libjail/lua_jail.c
@@ -113,7 +113,6 @@ l_getparams(lua_State *L)
"expected a jail name (string) or id (integer)");
luaL_checktype(L, 2, LUA_TTABLE);
params_count = 1 + lua_rawlen(L, 2);
- luaL_argcheck(L, params_count > 1, 2, "expected #params > 0");
flags = luaL_optinteger(L, 3, 0);
params = malloc(params_count * sizeof(struct jailparam));
@@ -236,7 +235,6 @@ l_setparams(lua_State *L)
lua_pushnil(L);
for (params_count = 1; lua_next(L, 2) != 0; ++params_count)
lua_pop(L, 1);
- luaL_argcheck(L, params_count > 1, 2, "expected #params > 0");
flags = luaL_optinteger(L, 3, 0);