[nginx] Sub filter: fixed initialization in http{} level (ticket...

Roman Arutyunyan arut at nginx.com
Mon Sep 21 20:10:49 UTC 2015


details:   http://hg.nginx.org/nginx/rev/fbbb1c1ce1eb
branches:  
changeset: 6247:fbbb1c1ce1eb
user:      Roman Arutyunyan <arut at nginx.com>
date:      Mon Sep 21 23:08:34 2015 +0300
description:
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.

diffstat:

 src/http/modules/ngx_http_sub_filter_module.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (14 lines):

diff -r 257b51c37c5a -r fbbb1c1ce1eb src/http/modules/ngx_http_sub_filter_module.c
--- a/src/http/modules/ngx_http_sub_filter_module.c	Fri Sep 11 20:13:06 2015 +0300
+++ b/src/http/modules/ngx_http_sub_filter_module.c	Mon Sep 21 23:08:34 2015 +0300
@@ -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;
 



More information about the nginx-devel mailing list