diff --git a/module/lua/lapi.c b/module/lua/lapi.c index 6a845c461052..75f8b2a1dd6f 100644 --- a/module/lua/lapi.c +++ b/module/lua/lapi.c @@ -251,6 +251,8 @@ LUA_API int lua_type (lua_State *L, int idx) { LUA_API const char *lua_typename (lua_State *L, int t) { UNUSED(L); + if (t > 8 || t < 0) + return "internal_type_error"; return ttypename(t); }