mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00: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:
parent
04e311a36d
commit
88fbe7ca1e
2 changed files with 3 additions and 5 deletions
|
@ -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)) { \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue