Fixed segmentation fault if http context is not defined.

This commit is contained in:
Andrei Belov
2014-05-12 17:07:59 +04:00
committed by Felipe Zimmerle
parent f8d2eb086b
commit 8a8041170e

View File

@@ -1083,6 +1083,12 @@ ngx_http_modsecurity_init(ngx_conf_t *cf)
static ngx_int_t
ngx_http_modsecurity_init_process(ngx_cycle_t *cycle)
{
if (ngx_http_cycle_get_module_main_conf(cycle, ngx_http_modsecurity)
== NULL)
{
return NGX_OK;
}
/* must set log hook here cf->log maybe changed */
modsecSetLogHook(cycle->log, modsecLog);
modsecInitProcess();