From 14110b311cc8e38d9b48e55b02386330ce3ed49a Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Sat, 6 Jan 2007 18:52:06 +0000 Subject: [PATCH] fix zero size shared zones --- src/core/ngx_cycle.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index 89408fb4a..ff4888ab2 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -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;