Skip to content

Commit f3ef704

Browse files
committed
modsecurity: fix segfault when logging conf error (closes owasp-modsecurity#87)
1 parent be784e3 commit f3ef704

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ngx_http_modsecurity_module.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ ngx_http_modsecurity_set_rules(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
345345
if (rc < 0) {
346346
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
347347
"Failed to load the rules: \"%V\": %s",
348-
value[1], error);
348+
&value[1], error);
349349
free((char *)error);
350350
return NGX_CONF_ERROR;
351351
}
@@ -387,7 +387,7 @@ ngx_http_modsecurity_set_rules_file(ngx_conf_t *cf, ngx_command_t *cmd,
387387
if (rc < 0) {
388388
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
389389
"Failed to load the rules from file %V: %s",
390-
value[1], error);
390+
&value[1], error);
391391
free((char *)error);
392392
return NGX_CONF_ERROR;
393393
}
@@ -431,7 +431,7 @@ ngx_http_modsecurity_set_rules_remote(ngx_conf_t *cf, ngx_command_t *cmd,
431431
if (rc < 0) {
432432
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
433433
"Failed to load the remote rules %V %V: %s",
434-
value[1], value[2], error);
434+
&value[1], &value[2], error);
435435
free((char *)error);
436436
return NGX_CONF_ERROR;
437437
}

0 commit comments

Comments
 (0)