From 29d633cbdddaee5b06b80e168dba0b1ee9ff2937 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 22 Jul 2020 13:45:53 -0400 Subject: [PATCH] LuaJIT: Remove more global functions that could be abused. --- src/LuaJITEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LuaJITEngine.cpp b/src/LuaJITEngine.cpp index 2ce826b..0ec77ef 100644 --- a/src/LuaJITEngine.cpp +++ b/src/LuaJITEngine.cpp @@ -114,8 +114,8 @@ struct LuaJITEngine : ScriptEngine { // Declare the function `_castBlock` used to transform `luaBlock` pointer into a LuaJIT cdata << "_ffi_cast = ffi.cast" << std::endl << "function _castBlock(b) return _ffi_cast('struct LuaProcessBlock*', b) end" << std::endl - // Unload ffi and require - << "ffi = nil; require = nil;" << std::endl; + // Remove global functions that could be abused + << "jit = nil; require = nil; ffi = nil; load = nil; loadfile = nil; loadstring = nil; dofile = nil;" << std::endl; std::string ffi_script = ffi_stream.str(); // Compile the ffi script