aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2015-09-21 23:08:34 +0300
committerRoman Arutyunyan <arut@nginx.com>2015-09-21 23:08:34 +0300
commitf64ff2445157e3a537e43f22c76daa7269c361a8 (patch)
tree760a8db8e67f4a8b4c94ef9a56f2bbed80d9226b
parentee37ff613fe2a746e23040a7a8aba64063123175 (diff)
downloadnginx-f64ff2445157e3a537e43f22c76daa7269c361a8.tar.gz
nginx-f64ff2445157e3a537e43f22c76daa7269c361a8.zip
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.
-rw-r--r--src/http/modules/ngx_http_sub_filter_module.c3
1 files changed, 2 insertions, 1 deletions
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;