Mercurial > hg > nginx
diff src/http/modules/ngx_http_sub_filter_module.c @ 6247:fbbb1c1ce1eb
Sub filter: fixed initialization in http{} level (ticket #791).
If sub_filter directive was only specified at http{} level, sub filter
internal data remained uninitialized. That would lead to a crash in runtime.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Mon, 21 Sep 2015 23:08:34 +0300 |
parents | 2c045e5b8291 |
children | 088ef087a011 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_sub_filter_module.c +++ b/src/http/modules/ngx_http_sub_filter_module.c @@ -853,8 +853,9 @@ ngx_http_sub_merge_conf(ngx_conf_t *cf, conf->pairs = prev->pairs; conf->matches = prev->matches; conf->tables = prev->tables; + } - } else if (conf->dynamic == 0){ + if (conf->pairs && conf->dynamic == 0 && conf->tables == NULL) { pairs = conf->pairs->elts; n = conf->pairs->nelts;