comparison src/core/ngx_cycle.c @ 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 9ef704d8563a
children 650574a44505
comparison
equal deleted inserted replaced
7365:cd4fa2fab8d8 7366:7bf3c323cb6e
919 919
920 file = NULL; 920 file = NULL;
921 921
922 #else 922 #else
923 923
924 file = ngx_pnalloc(cycle->pool, cycle->lock_file.len + zn->shm.name.len); 924 file = ngx_pnalloc(cycle->pool,
925 cycle->lock_file.len + zn->shm.name.len + 1);
925 if (file == NULL) { 926 if (file == NULL) {
926 return NGX_ERROR; 927 return NGX_ERROR;
927 } 928 }
928 929
929 (void) ngx_sprintf(file, "%V%V%Z", &cycle->lock_file, &zn->shm.name); 930 (void) ngx_sprintf(file, "%V%V%Z", &cycle->lock_file, &zn->shm.name);