comparison src/http/modules/ngx_http_proxy_module.c @ 7001:08537eab4f23

Upstream: fixed u->headers_in.headers allocation error handling. Previously, an allocation error resulted in uninitialized memory access when evaluating $upstream_http_ variables. On a related note, see r->headers_out.headers cleanup work in 0cdee26605f3.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 18 May 2017 14:17:00 +0300
parents 08dc60979133
children 3fef8c5caa75
comparison
equal deleted inserted replaced
7000:d8e8ced78e77 7001:08537eab4f23
1796 h->value.len = r->header_end - r->header_start; 1796 h->value.len = r->header_end - r->header_start;
1797 1797
1798 h->key.data = ngx_pnalloc(r->pool, 1798 h->key.data = ngx_pnalloc(r->pool,
1799 h->key.len + 1 + h->value.len + 1 + h->key.len); 1799 h->key.len + 1 + h->value.len + 1 + h->key.len);
1800 if (h->key.data == NULL) { 1800 if (h->key.data == NULL) {
1801 h->hash = 0;
1801 return NGX_ERROR; 1802 return NGX_ERROR;
1802 } 1803 }
1803 1804
1804 h->value.data = h->key.data + h->key.len + 1; 1805 h->value.data = h->key.data + h->key.len + 1;
1805 h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1; 1806 h->lowcase_key = h->key.data + h->key.len + 1 + h->value.len + 1;