Skip to content

Commit

Permalink
modsecurity: fix segfault when logging conf error (closes owasp-modse…
Browse files Browse the repository at this point in the history
  • Loading branch information
pracj3am committed Oct 10, 2023
1 parent c8d627b commit f632ace
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ngx_http_modsecurity_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ ngx_http_modsecurity_set_rules(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (rc < 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"Failed to load the rules: \"%V\": %s",
value[1], error);
&value[1], error);
free((char *)error);
return NGX_CONF_ERROR;
}
Expand Down Expand Up @@ -387,7 +387,7 @@ ngx_http_modsecurity_set_rules_file(ngx_conf_t *cf, ngx_command_t *cmd,
if (rc < 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"Failed to load the rules from file %V: %s",
value[1], error);
&value[1], error);
free((char *)error);
return NGX_CONF_ERROR;
}
Expand Down Expand Up @@ -431,7 +431,7 @@ ngx_http_modsecurity_set_rules_remote(ngx_conf_t *cf, ngx_command_t *cmd,
if (rc < 0) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"Failed to load the remote rules %V %V: %s",
value[1], value[2], error);
&value[1], &value[2], error);
free((char *)error);
return NGX_CONF_ERROR;
}
Expand Down

0 comments on commit f632ace

Please sign in to comment.