summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-04-30 19:16:55 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-04-30 19:16:55 +0400
commit094bfc6beb3672863bd3475c2549628fcb03b7e6 (patch)
tree6b7638107ffe457432b51372c85a31e0e04b0662 /src
parentaa28897b22f1e5f6c2345545099bf815232b6a7b (diff)
downloadnginx-094bfc6beb3672863bd3475c2549628fcb03b7e6.tar.gz
nginx-094bfc6beb3672863bd3475c2549628fcb03b7e6.tar.bz2
Upstream: restored workaround for "if".
The 7022564a9e0e changeset made ineffective workaround from 2464ccebdb52 to avoid NULL pointer dereference with "if". It is now restored by moving the u->ssl_name initialization after the check. Found by Coverity (CID 1210408).
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_upstream.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index a64538309..de3ff130a 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -584,9 +584,6 @@ ngx_http_upstream_init_request(ngx_http_request_t *r)
if (u->resolved == NULL) {
uscf = u->conf->upstream;
-#if (NGX_HTTP_SSL)
- u->ssl_name = uscf->host;
-#endif
} else {
@@ -680,6 +677,10 @@ found:
return;
}
+#if (NGX_HTTP_SSL)
+ u->ssl_name = uscf->host;
+#endif
+
if (uscf->peer.init(r, uscf) != NGX_OK) {
ngx_http_upstream_finalize_request(r, u,
NGX_HTTP_INTERNAL_SERVER_ERROR);