aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2011-10-31 09:57:14 +0000
committerMaxim Dounin <mdounin@mdounin.ru>2011-10-31 09:57:14 +0000
commitca495238bdae985d1debef8df804087b12d8313d (patch)
tree9c4d19d0226efd6c95e5453ff18142f95443e186
parent0d59500343d3cea70b89eb57e45be86da69c0f8d (diff)
downloadnginx-ca495238bdae985d1debef8df804087b12d8313d.tar.gz
nginx-ca495238bdae985d1debef8df804087b12d8313d.zip
Fixed segfault on configuration testing with ssl (ticket #37).
The following config caused segmentation fault due to conf->file not being properly set if "ssl on" was inherited from the http level: http { ssl on; server { } }
-rw-r--r--src/http/modules/ngx_http_ssl_module.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/http/modules/ngx_http_ssl_module.c b/src/http/modules/ngx_http_ssl_module.c
index 192fc3e35..f1f6a4ae4 100644
--- a/src/http/modules/ngx_http_ssl_module.c
+++ b/src/http/modules/ngx_http_ssl_module.c
@@ -346,7 +346,16 @@ ngx_http_ssl_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_pool_cleanup_t *cln;
- ngx_conf_merge_value(conf->enable, prev->enable, 0);
+ if (conf->enable == NGX_CONF_UNSET) {
+ if (prev->enable == NGX_CONF_UNSET) {
+ conf->enable = 0;
+
+ } else {
+ conf->enable = prev->enable;
+ conf->file = prev->file;
+ conf->line = prev->line;
+ }
+ }
ngx_conf_merge_value(conf->session_timeout,
prev->session_timeout, 300);