comparison src/http/ngx_http_upstream.c @ 5682:110b50657d77

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).
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 30 Apr 2014 19:16:55 +0400
parents 3a48775f1535
children efc84a5723b3
comparison
equal deleted inserted replaced
5681:56ad171c3dd1 5682:110b50657d77
582 u->cleanup = &cln->handler; 582 u->cleanup = &cln->handler;
583 583
584 if (u->resolved == NULL) { 584 if (u->resolved == NULL) {
585 585
586 uscf = u->conf->upstream; 586 uscf = u->conf->upstream;
587 #if (NGX_HTTP_SSL)
588 u->ssl_name = uscf->host;
589 #endif
590 587
591 } else { 588 } else {
592 589
593 #if (NGX_HTTP_SSL) 590 #if (NGX_HTTP_SSL)
594 u->ssl_name = u->resolved->host; 591 u->ssl_name = u->resolved->host;
677 "no upstream configuration"); 674 "no upstream configuration");
678 ngx_http_upstream_finalize_request(r, u, 675 ngx_http_upstream_finalize_request(r, u,
679 NGX_HTTP_INTERNAL_SERVER_ERROR); 676 NGX_HTTP_INTERNAL_SERVER_ERROR);
680 return; 677 return;
681 } 678 }
679
680 #if (NGX_HTTP_SSL)
681 u->ssl_name = uscf->host;
682 #endif
682 683
683 if (uscf->peer.init(r, uscf) != NGX_OK) { 684 if (uscf->peer.init(r, uscf) != NGX_OK) {
684 ngx_http_upstream_finalize_request(r, u, 685 ngx_http_upstream_finalize_request(r, u,
685 NGX_HTTP_INTERNAL_SERVER_ERROR); 686 NGX_HTTP_INTERNAL_SERVER_ERROR);
686 return; 687 return;