From: Aki Tuomi Date: Sat, 20 Jan 2018 13:44:56 +0000 (+0200) Subject: auth: db-lua - Do not assert-crash if given parameter was not auth_request X-Git-Tag: 2.3.9~2455 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1407b9891856fdc5be288070a6619a01c62dd7d;p=thirdparty%2Fdovecot%2Fcore.git auth: db-lua - Do not assert-crash if given parameter was not auth_request Use luaL_error instead that will back out more gracefully. Fixes Panic: file db-lua.c: line 279 (auth_lua_check_auth_request): assertion failed: (lua_istable(script->L, arg)) --- diff --git a/src/auth/db-lua.c b/src/auth/db-lua.c index c7bee974de..1c602f0942 100644 --- a/src/auth/db-lua.c +++ b/src/auth/db-lua.c @@ -275,7 +275,11 @@ static void auth_lua_push_auth_request(struct dlua_script *script, struct auth_r static struct auth_request * auth_lua_check_auth_request(struct dlua_script *script, int arg) { - i_assert(lua_istable(script->L, arg)); + if (!lua_istable(script->L, arg)) { + (void)luaL_error(script->L, "Bad argument #%d, expected %s got %s", + arg, "auth_request", + lua_typename(script->L, lua_type(script->L, arg))); + } lua_pushstring(script->L, "item"); lua_rawget(script->L, arg); void *bp = (void*)lua_touserdata(script->L, -1);