{
const auto *cookie = lua_tostring(L, lua_upvalueindex(1));
auto *task = lua_check_task(L, 1);
+
+ if (task == nullptr) {
+ return 0;
+ }
+
auto *rt = REDIS_RUNTIME(rspamd_mempool_get_variable(task->task_pool, cookie));
if (rt == nullptr) {
- msg_err_task("internal error: cannot find runtime for cookie %s", cookie);
+ msg_err_task("cannot find runtime for cookie %s", cookie);
return 0;
}
{
const auto *cookie = lua_tostring(L, lua_upvalueindex(1));
auto *task = lua_check_task(L, 1);
+
+ if (task == nullptr) {
+ return 0;
+ }
+
auto *rt = REDIS_RUNTIME(rspamd_mempool_get_variable(task->task_pool, cookie));
if (rt == nullptr) {
- msg_err_task("internal error: cannot find runtime for cookie %s", cookie);
+ msg_err_task("cannot find runtime for cookie %s", cookie);
return 0;
}
gboolean no_cache = FALSE, strict_pubkey_check = FALSE;
struct dkim_ctx *dkim_module_ctx;
+ if (task == NULL) {
+ return luaL_error(L, "invalid task");
+ }
+
luaL_argcheck(L, lua_type(L, 2) == LUA_TTABLE, 2, "'table' expected");
/*
* Get the following elements:
struct dkim_ctx *dkim_module_ctx;
rspamd_dkim_sign_key_t **pkey;
+ if (task == NULL) {
+ return luaL_error(L, "invalid task");
+ }
+
luaL_argcheck(L, lua_type(L, 2) == LUA_TTABLE, 2, "'table' expected");
if (!rspamd_lua_parse_table_arguments(L, 2, &err,
const unsigned char *digest_data;
char *sig_b64 = NULL;
+ if (task == NULL) {
+ return luaL_error(L, "invalid task");
+ }
+
luaL_argcheck(L, lua_type(L, 2) == LUA_TTABLE, 2, "'table' expected");
/* Get sign_key from table */