Skip to content

Commit

Permalink
Fix case where ngx_http_variable_unknown_header could be called on a …
Browse files Browse the repository at this point in the history
…null pointer

Regression introduced by refactoring in 8ffc053

Fixes evanmiller#30
  • Loading branch information
anthonyryan1 committed May 6, 2015
1 parent 9eddaa4 commit 11665b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ngx_http_zip_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ 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->upstream != NULL) {
variable_header_status = ngx_http_variable_unknown_header(vv,
&ngx_http_zip_header_variable_name,
&r->headers_out.headers.part, sizeof("upstream_http_") - 1);
&r->headers_out.headers.part,
sizeof("upstream_http_") - 1);
}

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

0 comments on commit 11665b8

Please sign in to comment.