Browse Source

LuaJIT: Remove more global functions that could be abused.

tags/v1.3.0
Andrew Belt 4 years ago
parent
commit
29d633cbdd
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/LuaJITEngine.cpp

+ 2
- 2
src/LuaJITEngine.cpp View File

@@ -114,8 +114,8 @@ struct LuaJITEngine : ScriptEngine {
// Declare the function `_castBlock` used to transform `luaBlock` pointer into a LuaJIT cdata // Declare the function `_castBlock` used to transform `luaBlock` pointer into a LuaJIT cdata
<< "_ffi_cast = ffi.cast" << std::endl << "_ffi_cast = ffi.cast" << std::endl
<< "function _castBlock(b) return _ffi_cast('struct LuaProcessBlock*', b) end" << 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(); std::string ffi_script = ffi_stream.str();


// Compile the ffi script // Compile the ffi script


Loading…
Cancel
Save