Skip to content

Commit bc390c6

Browse files
defanatorFelipe Zimmerle
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 ce21d6b commit bc390c6

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
@@ -1143,7 +1143,7 @@ ngx_http_modsecurity_handler(ngx_http_request_t *r) {
11431143
ngx_http_modsecurity_ctx_t *ctx = NULL;
11441144
ngx_http_modsecurity_loc_conf_t *cf = NULL;
11451145

1146-
modsecSetLogHook(r->connection->log, modsecLog);
1146+
modsecSetLogHook(ngx_cycle->log, modsecLog);
11471147

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

0 commit comments

Comments
 (0)