Skip to content

Commit a18b409

Browse files
committed
Merge pull request #8 from mikegagnon/master
fixed off-by-one bug in the calculation of shm_name->len
2 parents 5f6a3b7 + 3a1d882 commit a18b409

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ngx_http_upstream_fair_module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ ngx_http_upstream_init_fair(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
610610
n = peers->number;
611611

612612
shm_name = ngx_palloc(cf->pool, sizeof *shm_name);
613-
shm_name->len = sizeof("upstream_fair");
613+
shm_name->len = sizeof("upstream_fair") - 1;
614614
shm_name->data = (unsigned char *) "upstream_fair";
615615

616616
if (ngx_http_upstream_fair_shm_size == 0) {

0 commit comments

Comments
 (0)