[nginx] svn commit: r4812 - trunk/src/http/modules

vbart at nginx.com vbart at nginx.com
Wed Aug 8 12:03:47 UTC 2012


Author: vbart
Date: 2012-08-08 12:03:46 +0000 (Wed, 08 Aug 2012)
New Revision: 4812
URL: http://trac.nginx.org/nginx/changeset/4812/nginx

Log:
Added three missing checks for NULL after ngx_array_push() calls.

Found by Coverity.


Modified:
   trunk/src/http/modules/ngx_http_fastcgi_module.c
   trunk/src/http/modules/ngx_http_limit_conn_module.c
   trunk/src/http/modules/ngx_http_limit_req_module.c

Modified: trunk/src/http/modules/ngx_http_fastcgi_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_fastcgi_module.c	2012-08-07 13:57:04 UTC (rev 4811)
+++ trunk/src/http/modules/ngx_http_fastcgi_module.c	2012-08-08 12:03:46 UTC (rev 4812)
@@ -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;

Modified: trunk/src/http/modules/ngx_http_limit_conn_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_limit_conn_module.c	2012-08-07 13:57:04 UTC (rev 4811)
+++ trunk/src/http/modules/ngx_http_limit_conn_module.c	2012-08-08 12:03:46 UTC (rev 4812)
@@ -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;
 

Modified: trunk/src/http/modules/ngx_http_limit_req_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_limit_req_module.c	2012-08-07 13:57:04 UTC (rev 4811)
+++ trunk/src/http/modules/ngx_http_limit_req_module.c	2012-08-08 12:03:46 UTC (rev 4812)
@@ -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;



More information about the nginx-devel mailing list