]> git.kaiwu.me - nginx.git/commitdiff
fix zero size shared zones
authorIgor Sysoev <igor@sysoev.ru>
Sat, 6 Jan 2007 18:52:06 +0000 (18:52 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 6 Jan 2007 18:52:06 +0000 (18:52 +0000)
src/core/ngx_cycle.c

index 89408fb4aca319f57902eee783138eef03d33b6a..ff4888ab247d295aee556015d51833129e56ac71 100644 (file)
@@ -366,6 +366,13 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
             i = 0;
         }
 
+        if (shm_zone[i].shm.size == 0) {
+            ngx_log_error(NGX_LOG_EMERG, log, 0,
+                          "zero size shared memory zone \"%V\"",
+                          &shm_zone[i].name);
+            goto failed;
+        }
+
         shm_zone[i].shm.log = cycle->log;
 
         opart = &old_cycle->shared_memory.part;