changeset 7366:7bf3c323cb6e

Fixed off-by-one error in shared zone initialization. On systems without atomic ops, not enough space was allocated for mutex's file name during shared zone initialization.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 02 Oct 2018 13:32:52 +0300
parents cd4fa2fab8d8
children bf1ac3dc1e68
files src/core/ngx_cycle.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -921,7 +921,8 @@ ngx_init_zone_pool(ngx_cycle_t *cycle, n
 
 #else
 
-    file = ngx_pnalloc(cycle->pool, cycle->lock_file.len + zn->shm.name.len);
+    file = ngx_pnalloc(cycle->pool,
+                       cycle->lock_file.len + zn->shm.name.len + 1);
     if (file == NULL) {
         return NGX_ERROR;
     }