Ticket #791: sub-main-conf.patch

File sub-main-conf.patch, 1.0 KB (added by Roman Arutyunyan, 11 years ago)
  • src/http/modules/ngx_http_sub_filter_module.c

    # HG changeset patch
    # User Roman Arutyunyan <arut@nginx.com>
    # Date 1442836198 -10800
    #      Mon Sep 21 14:49:58 2015 +0300
    # Node ID a58e3a3304e0a15092291d216dc1346b808d83ce
    # Parent  de3b5bc41b8623e6f3fd9f670e5a92fc1a84701e
    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.
    
    diff -r de3b5bc41b86 -r a58e3a3304e0 src/http/modules/ngx_http_sub_filter_module.c
    a b ngx_http_sub_merge_conf(ngx_conf_t *cf,  
    853853        conf->pairs = prev->pairs;
    854854        conf->matches = prev->matches;
    855855        conf->tables = prev->tables;
     856    }
    856857
    857     } else if (conf->dynamic == 0){
     858    if (conf->pairs && conf->dynamic == 0 && conf->tables == NULL) {
    858859        pairs = conf->pairs->elts;
    859860        n = conf->pairs->nelts;
    860861