aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_security.cpp
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-03-29 12:07:00 -0400
committerGitHub <noreply@github.com>2022-03-29 18:07:00 +0200
commit06d197cdd042392e1551e5e7244c61300a6bb4e3 (patch)
treec47a0c58917f5f89af1c5128e42611d0d8a3d320 /src/script/cpp_api/s_security.cpp
parent11aab4198be1a0f1104a433896e908e4c86de0c9 (diff)
downloadminetest-06d197cdd042392e1551e5e7244c61300a6bb4e3.tar.gz
minetest-06d197cdd042392e1551e5e7244c61300a6bb4e3.tar.bz2
minetest-06d197cdd042392e1551e5e7244c61300a6bb4e3.zip
Store vector metatable in registry
Diffstat (limited to 'src/script/cpp_api/s_security.cpp')
-rw-r--r--src/script/cpp_api/s_security.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp
index a6c5114b2..f68cd1777 100644
--- a/src/script/cpp_api/s_security.cpp
+++ b/src/script/cpp_api/s_security.cpp
@@ -98,6 +98,7 @@ void ScriptApiSecurity::initializeSecurity()
"type",
"unpack",
"_VERSION",
+ "vector",
"xpcall",
};
static const char *whitelist_tables[] = {
@@ -254,6 +255,10 @@ void ScriptApiSecurity::initializeSecurity()
lua_pushnil(L);
lua_setfield(L, old_globals, "core");
+ // 'vector' as well.
+ lua_pushnil(L);
+ lua_setfield(L, old_globals, "vector");
+
lua_pop(L, 1); // Pop globals_backup
@@ -296,6 +301,7 @@ void ScriptApiSecurity::initializeSecurityClient()
"type",
"unpack",
"_VERSION",
+ "vector",
"xpcall",
// Completely safe libraries
"coroutine",