Fixed segmentation fault if http context is not defined.

This commit is contained in:
Andrei Belov
2014-05-12 17:07:59 +04:00
parent c4a5a1e11a
commit 62ead2a12c

View File

@@ -938,6 +938,12 @@ ngx_http_modsecurity_init(ngx_conf_t *cf)
static ngx_int_t static ngx_int_t
ngx_http_modsecurity_init_process(ngx_cycle_t *cycle) 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 */ /* must set log hook here cf->log maybe changed */
modsecSetLogHook(cycle->log, modsecLog); modsecSetLogHook(cycle->log, modsecLog);
modsecInitProcess(); modsecInitProcess();