Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fixed off-by-one bug in the calculation of shm_name->len #8

Merged
merged 1 commit into from

2 participants

@mikegagnon

shm_name->len should be the length of the string, not the number of bytes in the character array (which includes the null sentinel)

@gnosek gnosek merged commit a18b409 into gnosek:master
@gnosek
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  ngx_http_upstream_fair_module.c
View
2  ngx_http_upstream_fair_module.c
@@ -610,7 +610,7 @@ ngx_http_upstream_init_fair(ngx_conf_t *cf, ngx_http_upstream_srv_conf_t *us)
n = peers->number;
shm_name = ngx_palloc(cf->pool, sizeof *shm_name);
- shm_name->len = sizeof("upstream_fair");
+ shm_name->len = sizeof("upstream_fair") - 1;
shm_name->data = (unsigned char *) "upstream_fair";
if (ngx_http_upstream_fair_shm_size == 0) {
Something went wrong with that request. Please try again.