Navigation Menu

Skip to content

Commit

Permalink
bugfix: core dump when ketama variable value is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
flygoast committed Sep 30, 2013
1 parent 33e37a4 commit 476363c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ngx_http_upstream_ketama_chash_module.c
Expand Up @@ -481,7 +481,8 @@ ngx_http_upstream_init_ketama_chash_peer(ngx_http_request_t *r,

if (!ukchpd->peers->single) {
ukchpd->point = ngx_crc32_short(val.data, val.len);
ukchpd->conti_index = ngx_http_upstream_get_ketama_chash_index(ukchpd);
ukchpd->conti_index = (ukchpd->point == 0) ? 0 :
ngx_http_upstream_get_ketama_chash_index(ukchpd);
}

return NGX_OK;
Expand Down

0 comments on commit 476363c

Please sign in to comment.