Welcome! Log In Create A New Profile

Advanced

[nginx] Access log: fix default value, broken by cb308813b453.

Sergey Kandaurov
June 05, 2014 08:18AM
details: http://hg.nginx.org/nginx/rev/7f425d67f91a
branches:
changeset: 5719:7f425d67f91a
user: Piotr Sikora <piotr@cloudflare.com>
date: Tue Jun 03 10:53:48 2014 -0700
description:
Access log: fix default value, broken by cb308813b453.

log->filter ("if" parameter) was uninitialized when the default value
was being used, which would lead to a crash (SIGSEGV) when access_log
directive wasn't specified in the configuration.

Zero-fill the whole structure instead of zeroing fields one-by-one
in order to prevent similar issues in the future.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>

diffstat:

src/http/modules/ngx_http_log_module.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)

diffs (22 lines):

diff -r c46657e391a3 -r 7f425d67f91a src/http/modules/ngx_http_log_module.c
--- a/src/http/modules/ngx_http_log_module.c Tue Jun 03 17:53:03 2014 +0400
+++ b/src/http/modules/ngx_http_log_module.c Tue Jun 03 10:53:48 2014 -0700
@@ -1109,16 +1109,13 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *
return NGX_CONF_ERROR;
}

+ ngx_memzero(log, sizeof(ngx_http_log_t));
+
log->file = ngx_conf_open_file(cf->cycle, &ngx_http_access_log);
if (log->file == NULL) {
return NGX_CONF_ERROR;
}

- log->script = NULL;
- log->disk_full_time = 0;
- log->error_log_time = 0;
- log->syslog_peer = NULL;
-
lmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_log_module);
fmt = lmcf->formats.elts;


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Access log: fix default value, broken by cb308813b453.

Sergey Kandaurov 675 June 05, 2014 08:18AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 128
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready