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).
if (u->resolved == NULL) {
uscf = u->conf->upstream;
-#if (NGX_HTTP_SSL)
- u->ssl_name = uscf->host;
-#endif
} else {
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);