aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2012-11-23 12:43:58 +0000
committerRuslan Ermilov <ru@nginx.com>2012-11-23 12:43:58 +0000
commita94a101c79a4d6d14eaffb210d2e7d0afb3de7b0 (patch)
tree6788319b48556fbaacd068ef6ab2d89699d541d4
parent9f385870f663ff48a511e07e63e85d28737c3384 (diff)
downloadnginx-a94a101c79a4d6d14eaffb210d2e7d0afb3de7b0.tar.gz
nginx-a94a101c79a4d6d14eaffb210d2e7d0afb3de7b0.zip
Core: don't reuse shared memory zone that changed ownership (ticket #210).
nginx doesn't allow the same shared memory zone to be used for different purposes, but failed to check this on reconfiguration. If a shared memory zone was used for another purpose in the new configuration, nginx attempted to reuse it and crashed.
-rw-r--r--src/core/ngx_cycle.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index f15372990..e8b155921 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -447,7 +447,9 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
continue;
}
- if (shm_zone[i].shm.size == oshm_zone[n].shm.size) {
+ if (shm_zone[i].tag == oshm_zone[n].tag
+ && shm_zone[i].shm.size == oshm_zone[n].shm.size)
+ {
shm_zone[i].shm.addr = oshm_zone[n].shm.addr;
if (shm_zone[i].init(&shm_zone[i], oshm_zone[n].data)