diff options
author | Piotr Sikora <piotr@cloudflare.com> | 2014-06-03 10:53:48 -0700 |
---|---|---|
committer | Piotr Sikora <piotr@cloudflare.com> | 2014-06-03 10:53:48 -0700 |
commit | a1a8defb4956ce5416ff633c47da2dc4d473fac0 (patch) | |
tree | 2c25bc4d32719bf3fea00372c8e8d70bd58a6db6 /src/http/modules/ngx_http_log_module.c | |
parent | afb4aafc6e42781068ce3f23d22fd6e2012787c7 (diff) | |
download | nginx-a1a8defb4956ce5416ff633c47da2dc4d473fac0.tar.gz nginx-a1a8defb4956ce5416ff633c47da2dc4d473fac0.zip |
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 (limited to 'src/http/modules/ngx_http_log_module.c')
-rw-r--r-- | src/http/modules/ngx_http_log_module.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c index f51ba938d..bc660cdd6 100644 --- a/src/http/modules/ngx_http_log_module.c +++ b/src/http/modules/ngx_http_log_module.c @@ -1109,16 +1109,13 @@ ngx_http_log_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child) 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; |