]> git.kaiwu.me - nginx.git/commit
Cleaned up r->headers_out.headers allocation error handling.
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 20 Apr 2017 15:26:37 +0000 (18:26 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Thu, 20 Apr 2017 15:26:37 +0000 (18:26 +0300)
commit9ecf8428645579cf66adc5ba939bf1267924c5bc
treebffebdeaec5665d8c6e1c128cffb6f9287773d2a
parent30e26a8c57fab4b7d95eacc7fd5c0bae23364529
Cleaned up r->headers_out.headers allocation error handling.

If initialization of a header failed for some reason after ngx_list_push(),
leaving the header as is can result in uninitialized memory access by
the header filter or the log module.  The fix is to clear partially
initialized headers in case of errors.

For the Cache-Control header, the fix is to postpone pushing
r->headers_out.cache_control until its value is completed.
src/http/modules/ngx_http_auth_basic_module.c
src/http/modules/ngx_http_dav_module.c
src/http/modules/ngx_http_headers_filter_module.c
src/http/modules/ngx_http_range_filter_module.c
src/http/modules/ngx_http_static_module.c
src/http/modules/perl/nginx.xs
src/http/ngx_http_core_module.c
src/http/ngx_http_upstream.c