Skip to content

Commit

Permalink
ngx_http_variable_unknown_header was causing segfaults during NPN neg…
Browse files Browse the repository at this point in the history
…otiation and

other requests that did not included non-null content in headers_out.headers.part

Fixes evanmiller#30
  • Loading branch information
anthonyryan1 committed May 7, 2015
1 parent 9624d21 commit aab1e2b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ngx_http_zip_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,12 @@ ngx_http_zip_main_request_header_filter(ngx_http_request_t *r)
if (r->upstream) {
variable_header_status = ngx_http_upstream_header_variable(r, vv,
(uintptr_t)(&ngx_http_zip_header_variable_name));
} else {
} else if (r->headers_out.status == NGX_HTTP_OK) {
variable_header_status = ngx_http_variable_unknown_header(vv,
&ngx_http_zip_header_variable_name,
&r->headers_out.headers.part, sizeof("upstream_http_") - 1);
} else {
vv->not_found = 1;
}

if (variable_header_status != NGX_OK || vv->not_found ||
Expand Down

0 comments on commit aab1e2b

Please sign in to comment.