From bc390c665928e87ded2285aa6c8b03af264d715f Mon Sep 17 00:00:00 2001 From: Andrei Belov Date: Fri, 6 Jun 2014 11:36:37 +0400 Subject: [PATCH] Use ngx_cycle to obtain log object in handler function. Previously used r->connection->log was causing segfault in some circumstances (in particular, in proxy_unfinished.t test). --- nginx/modsecurity/ngx_http_modsecurity.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx/modsecurity/ngx_http_modsecurity.c b/nginx/modsecurity/ngx_http_modsecurity.c index c967413f..9e9b2365 100644 --- a/nginx/modsecurity/ngx_http_modsecurity.c +++ b/nginx/modsecurity/ngx_http_modsecurity.c @@ -1143,7 +1143,7 @@ ngx_http_modsecurity_handler(ngx_http_request_t *r) { ngx_http_modsecurity_ctx_t *ctx = NULL; ngx_http_modsecurity_loc_conf_t *cf = NULL; - modsecSetLogHook(r->connection->log, modsecLog); + modsecSetLogHook(ngx_cycle->log, modsecLog); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "ModSec: Catching a new access phase handler. Count: %d",