Commit 756a1669 authored by Daniel Salzman's avatar Daniel Salzman

cookies: fix uninitialized module context access

parent 6748dc3e
......@@ -244,6 +244,9 @@ int cookies_load(knotd_mod_t *mod)
return ret;
}
// Store module context before rollover thread is created.
knotd_mod_ctx_set(mod, ctx);
// Initialize the server secret.
conf = knotd_conf_mod(mod, MOD_SECRET);
if (conf.count == 1) {
......@@ -273,8 +276,6 @@ int cookies_load(knotd_mod_t *mod)
ctx->badcookie_slip = 1;
#endif
knotd_mod_ctx_set(mod, ctx);
return knotd_mod_hook(mod, KNOTD_STAGE_BEGIN, cookies_process);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment