summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--module/lua/lapi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/module/lua/lapi.c b/module/lua/lapi.c
index 6a845c461..75f8b2a1d 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);
}