Skip to content

Commit

Permalink
Fixed off-by-one error in shared zone initialization.
Browse files Browse the repository at this point in the history
On systems without atomic ops, not enough space was allocated
for mutex's file name during shared zone initialization.
  • Loading branch information
mdocguard committed Oct 2, 2018
1 parent a50dec6 commit df0dfa6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/ngx_cycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,8 @@ ngx_init_zone_pool(ngx_cycle_t *cycle, ngx_shm_zone_t *zn)

#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;
}
Expand Down

0 comments on commit df0dfa6

Please sign in to comment.