Mercurial > hg > nginx
changeset 4933:72e11139760b
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.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Fri, 23 Nov 2012 12:43:58 +0000 |
parents | 0fce5bb53b2d |
children | b61edaa04342 |
files | src/core/ngx_cycle.c |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_cycle.c Wed Nov 21 14:23:26 2012 +0000 +++ b/src/core/ngx_cycle.c Fri Nov 23 12:43:58 2012 +0000 @@ -447,7 +447,9 @@ 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)