#include "util-debug.h"
#include "util-lua-sandbox.h"
#include "util-lua-builtins.h"
+#include "util-validate.h"
#define SANDBOX_CTX "SANDBOX_CTX"
SCLuaSbState *context = SCLuaSbGetContext(L);
context->blocked_function_error = true;
lua_Debug ar;
- lua_getstack(L, 0, &ar);
- lua_getinfo(L, "n", &ar);
- if (ar.name) {
+ if (lua_getstack(L, 0, &ar) && lua_getinfo(L, "n", &ar) && ar.name) {
luaL_error(L, "Blocked Lua function called: %s", ar.name);
} else {
luaL_error(L, "Blocked Lua function: name not available");
}
+ /* never reached */
+ DEBUG_VALIDATE_BUG_ON(1);
return -1;
}