﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1378	fix a bug that in the function ngx_http_subrequest, it will make the headers_in.headers incorrect，and it will cause many problems	fishgege@…		"//sr->headers_in = r->headers_in;
This line of code copy the headers ,but it maybe make the struct mistake that sr->headers_in.headers.last mismatch &sr->headers_in.headers.part, when only one part be copied, the mismatch happen. if somewhere use sr->headers_in.headers.last ，it will cause assert or some other problems。fx：in the function ngx_http_headers_more_assert
so only when there is only one part, the mismatch happen , and I update for this.


src/http/ngx_http_core_module.c
 @@ -2274,6 +2274,9 @@ ngx_http_subrequest(ngx_http_request_t *r,
      sr->pool = r->pool;
  
      sr->headers_in = r->headers_in;
 +    if (sr->headers_in.headers.part.next == NULL) {
 +        sr->headers_in.headers.last = &sr->headers_in.headers.part;
 +    }
  
      ngx_http_clear_content_length(sr);
      ngx_http_clear_accept_ranges(sr);"	defect	closed	major		nginx-core	1.13.x	invalid	subrequest		Linux Not-Used-KS6-zyVSt5ae4a 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.13.5
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) "
