fix segfault, introduced in r2423

This commit is contained in:
Igor Sysoev 2008-12-24 16:18:35 +00:00
parent 503c075122
commit 9b753d2eea
2 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ ngx_http_fastcgi_eval(ngx_http_request_t *r, ngx_http_fastcgi_loc_conf_t *flcf)
return NGX_ERROR; return NGX_ERROR;
} }
if (u.addrs[0].sockaddr) { if (u.addrs && u.addrs[0].sockaddr) {
r->upstream->resolved->sockaddr = u.addrs[0].sockaddr; r->upstream->resolved->sockaddr = u.addrs[0].sockaddr;
r->upstream->resolved->socklen = u.addrs[0].socklen; r->upstream->resolved->socklen = u.addrs[0].socklen;
r->upstream->resolved->naddrs = 1; r->upstream->resolved->naddrs = 1;

View File

@ -614,7 +614,7 @@ ngx_http_proxy_eval(ngx_http_request_t *r, ngx_http_proxy_ctx_t *ctx,
return NGX_ERROR; return NGX_ERROR;
} }
if (u.addrs[0].sockaddr) { if (u.addrs && u.addrs[0].sockaddr) {
r->upstream->resolved->sockaddr = u.addrs[0].sockaddr; r->upstream->resolved->sockaddr = u.addrs[0].sockaddr;
r->upstream->resolved->socklen = u.addrs[0].socklen; r->upstream->resolved->socklen = u.addrs[0].socklen;
r->upstream->resolved->naddrs = 1; r->upstream->resolved->naddrs = 1;