Skip to content

Commit f8af92f

Browse files
defanatorchewi
authored andcommitted
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).
1 parent ee27bf4 commit f8af92f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nginx/modsecurity/ngx_http_modsecurity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,7 +1137,7 @@ ngx_http_modsecurity_handler(ngx_http_request_t *r) {
11371137
ngx_http_modsecurity_ctx_t *ctx = NULL;
11381138
ngx_http_modsecurity_loc_conf_t *cf = NULL;
11391139

1140-
modsecSetLogHook(r->connection->log, modsecLog);
1140+
modsecSetLogHook(ngx_cycle->log, modsecLog);
11411141

11421142
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
11431143
"ModSec: Catching a new access phase handler. Count: %d",

0 commit comments

Comments
 (0)