aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_fastcgi_module.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2017-05-18 14:17:00 +0300
committerSergey Kandaurov <pluknet@nginx.com>2017-05-18 14:17:00 +0300
commit9359155b2fb443ac3c2cf0d897d5db668585235b (patch)
tree3fb886f452f0c5db7e71b1a245653b8ca9016ecd /src/http/modules/ngx_http_fastcgi_module.c
parent84fdff7930986b436dfeea21134cee598b129d97 (diff)
downloadnginx-9359155b2fb443ac3c2cf0d897d5db668585235b.tar.gz
nginx-9359155b2fb443ac3c2cf0d897d5db668585235b.zip
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.
Diffstat (limited to 'src/http/modules/ngx_http_fastcgi_module.c')
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index 06c19738d..741e57768 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1878,6 +1878,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
p = ngx_pnalloc(r->pool, size);
if (p == NULL) {
+ h->hash = 0;
return NGX_ERROR;
}
@@ -1900,6 +1901,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
"invalid header after joining "
"FastCGI records");
+ h->hash = 0;
return NGX_ERROR;
}
@@ -1925,6 +1927,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
h->key.len + 1 + h->value.len + 1
+ h->key.len);
if (h->key.data == NULL) {
+ h->hash = 0;
return NGX_ERROR;
}