]> git.kaiwu.me - nginx.git/commitdiff
Added three missing checks for NULL after ngx_array_push() calls.
authorValentin Bartenev <vbart@nginx.com>
Wed, 8 Aug 2012 12:03:46 +0000 (12:03 +0000)
committerValentin Bartenev <vbart@nginx.com>
Wed, 8 Aug 2012 12:03:46 +0000 (12:03 +0000)
Found by Coverity.

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

index 55c3aef2931d8d9e829098ec85a9315bf6bbb523..e8ff24cac94c12e17f6c2d50729a1f2758bc88e6 100644 (file)
@@ -1626,6 +1626,9 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
         }
 
         part = ngx_array_push(f->split_parts);
+        if (part == NULL) {
+            return NGX_ERROR;
+        }
 
         part->start = part_start;
         part->end = part_end;
index 106da7a535e8ef76ccacdef187d617c22b2bf34c..e82ca493dab30ee967d5019e793db0444523f23b 100644 (file)
@@ -721,6 +721,10 @@ ngx_http_limit_conn(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     }
 
     limit = ngx_array_push(&lccf->limits);
+    if (limit == NULL) {
+        return NGX_CONF_ERROR;
+    }
+
     limit->conn = n;
     limit->shm_zone = shm_zone;
 
index 18db7154958e6c3ad50b2496611246a262c7aecf..3f9910e7178ea9af1179b5f563c2782b73129967 100644 (file)
@@ -937,6 +937,9 @@ ngx_http_limit_req(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
     }
 
     limit = ngx_array_push(&lrcf->limits);
+    if (limit == NULL) {
+        return NGX_CONF_ERROR;
+    }
 
     limit->shm_zone = shm_zone;
     limit->burst = burst * 1000;