mirror of
https://github.com/minetest/minetest.git
synced 2025-06-30 23:20:22 +02:00
Use LuaErrors in security check macros
Throwing a LuaError calls destructors as it propagates up the stack, wheres lua_error just executes a longjmp.
This commit is contained in:
@ -25,9 +25,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
|
||||
#define CHECK_SECURE_PATH(L, path) \
|
||||
if (!ScriptApiSecurity::checkPath(L, path)) { \
|
||||
lua_pushstring(L, (std::string("Attempt to access external file ") + \
|
||||
path + " with mod security on.").c_str()); \
|
||||
lua_error(L); \
|
||||
throw LuaError(std::string("Attempt to access external file ") + \
|
||||
path + " with mod security on."); \
|
||||
}
|
||||
#define CHECK_SECURE_PATH_OPTIONAL(L, path) \
|
||||
if (ScriptApiSecurity::isSecure(L)) { \
|
||||
|
Reference in New Issue
Block a user