Welcome! Log In Create A New Profile

Advanced

[nginx] Upstream: restored workaround for "if".

Maxim Dounin
April 30, 2014 11:20AM
details: http://hg.nginx.org/nginx/rev/110b50657d77
branches:
changeset: 5682:110b50657d77
user: Maxim Dounin <mdounin@mdounin.ru>
date: Wed Apr 30 19:16:55 2014 +0400
description:
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:

src/http/ngx_http_upstream.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)

diffs (24 lines):

diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
--- 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_
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);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Upstream: restored workaround for "if".

Maxim Dounin 1015 April 30, 2014 11:20AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 206
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready