Mercurial > hg > nginx
changeset 4811:21d1e3bcb356
Added three missing checks for NULL after ngx_array_push() calls.
Found by Coverity.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Wed, 08 Aug 2012 12:03:46 +0000 |
parents | e1d11fb9a71f |
children | 785ae4de268b |
files | src/http/modules/ngx_http_fastcgi_module.c src/http/modules/ngx_http_limit_conn_module.c src/http/modules/ngx_http_limit_req_module.c |
diffstat | 3 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_fastcgi_module.c Tue Aug 07 13:57:04 2012 +0000 +++ b/src/http/modules/ngx_http_fastcgi_module.c Wed Aug 08 12:03:46 2012 +0000 @@ -1626,6 +1626,9 @@ } part = ngx_array_push(f->split_parts); + if (part == NULL) { + return NGX_ERROR; + } part->start = part_start; part->end = part_end;
--- a/src/http/modules/ngx_http_limit_conn_module.c Tue Aug 07 13:57:04 2012 +0000 +++ b/src/http/modules/ngx_http_limit_conn_module.c Wed Aug 08 12:03:46 2012 +0000 @@ -721,6 +721,10 @@ } limit = ngx_array_push(&lccf->limits); + if (limit == NULL) { + return NGX_CONF_ERROR; + } + limit->conn = n; limit->shm_zone = shm_zone;
--- a/src/http/modules/ngx_http_limit_req_module.c Tue Aug 07 13:57:04 2012 +0000 +++ b/src/http/modules/ngx_http_limit_req_module.c Wed Aug 08 12:03:46 2012 +0000 @@ -937,6 +937,9 @@ } limit = ngx_array_push(&lrcf->limits); + if (limit == NULL) { + return NGX_CONF_ERROR; + } limit->shm_zone = shm_zone; limit->burst = burst * 1000;