From: Igor Sysoev Date: Wed, 28 Oct 2009 10:45:40 +0000 (+0000) Subject: fix segfault if http {} block is empty, the bug had been introduced in r3218 X-Git-Tag: release-0.8.22~31 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=cadac4ec3e0f15974b1f4a0e2a7b5aebe8d76b73;p=nginx.git fix segfault if http {} block is empty, the bug had been introduced in r3218 --- diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c index 99ccef934..534fabf1b 100644 --- a/src/http/ngx_http.c +++ b/src/http/ngx_http.c @@ -1352,6 +1352,10 @@ ngx_http_optimize_servers(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf, ngx_http_conf_port_t *port; ngx_http_conf_addr_t *addr; + if (ports == NULL) { + return NGX_OK; + } + port = ports->elts; for (p = 0; p < ports->nelts; p++) {