Mercurial > hg > nginx
comparison 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 |
comparison
equal
deleted
inserted
replaced
6246:257b51c37c5a | 6247:fbbb1c1ce1eb |
---|---|
851 if (conf->pairs == NULL) { | 851 if (conf->pairs == NULL) { |
852 conf->dynamic = prev->dynamic; | 852 conf->dynamic = prev->dynamic; |
853 conf->pairs = prev->pairs; | 853 conf->pairs = prev->pairs; |
854 conf->matches = prev->matches; | 854 conf->matches = prev->matches; |
855 conf->tables = prev->tables; | 855 conf->tables = prev->tables; |
856 | 856 } |
857 } else if (conf->dynamic == 0){ | 857 |
858 if (conf->pairs && conf->dynamic == 0 && conf->tables == NULL) { | |
858 pairs = conf->pairs->elts; | 859 pairs = conf->pairs->elts; |
859 n = conf->pairs->nelts; | 860 n = conf->pairs->nelts; |
860 | 861 |
861 matches = ngx_pnalloc(cf->pool, sizeof(ngx_http_sub_match_t) * n); | 862 matches = ngx_pnalloc(cf->pool, sizeof(ngx_http_sub_match_t) * n); |
862 if (matches == NULL) { | 863 if (matches == NULL) { |