From f64ff2445157e3a537e43f22c76daa7269c361a8 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Mon, 21 Sep 2015 23:08:34 +0300 Subject: [PATCH] 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. --- src/http/modules/ngx_http_sub_filter_module.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/http/modules/ngx_http_sub_filter_module.c b/src/http/modules/ngx_http_sub_filter_module.c index 0a4ff6d80..8ba75edb7 100644 --- 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, void *parent, void *child) 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;