# HG changeset patch # User Valentin Bartenev # Date 1344427426 0 # Node ID 21d1e3bcb356db013bc2968a969092d063308690 # Parent e1d11fb9a71f5b6c30d555dff205bf9f1b84ad84 Added three missing checks for NULL after ngx_array_push() calls. Found by Coverity. diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c --- a/src/http/modules/ngx_http_fastcgi_module.c +++ b/src/http/modules/ngx_http_fastcgi_module.c @@ -1626,6 +1626,9 @@ ngx_http_fastcgi_process_header(ngx_http } part = ngx_array_push(f->split_parts); + if (part == NULL) { + return NGX_ERROR; + } part->start = part_start; part->end = part_end; diff --git a/src/http/modules/ngx_http_limit_conn_module.c b/src/http/modules/ngx_http_limit_conn_module.c --- a/src/http/modules/ngx_http_limit_conn_module.c +++ b/src/http/modules/ngx_http_limit_conn_module.c @@ -721,6 +721,10 @@ ngx_http_limit_conn(ngx_conf_t *cf, ngx_ } limit = ngx_array_push(&lccf->limits); + if (limit == NULL) { + return NGX_CONF_ERROR; + } + limit->conn = n; limit->shm_zone = shm_zone; diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c --- a/src/http/modules/ngx_http_limit_req_module.c +++ b/src/http/modules/ngx_http_limit_req_module.c @@ -937,6 +937,9 @@ ngx_http_limit_req(ngx_conf_t *cf, ngx_c } limit = ngx_array_push(&lrcf->limits); + if (limit == NULL) { + return NGX_CONF_ERROR; + } limit->shm_zone = shm_zone; limit->burst = burst * 1000;