Mercurial > hg > nginx
diff src/http/modules/ngx_http_geo_module.c @ 2457:1aff348d9aa8
fix segfault when geo range replaces starting part of another range
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 19 Jan 2009 16:42:14 +0000 |
parents | 95f078e7d743 |
children | 2e91aecb9e57 |
line wrap: on
line diff
--- a/src/http/modules/ngx_http_geo_module.c +++ b/src/http/modules/ngx_http_geo_module.c @@ -636,8 +636,8 @@ ngx_http_geo_add_range(ngx_conf_t *cf, n range = a->elts; - ngx_memcpy(&range[i + 2], &range[i + 1], - (a->nelts - 2 - i) * sizeof(ngx_http_geo_range_t)); + ngx_memcpy(&range[i + 1], &range[i], + (a->nelts - 1 - i) * sizeof(ngx_http_geo_range_t)); range[i + 1].start = (u_short) (e + 1);