fix segfault when geo range replaces starting part of another range

This commit is contained in:
Igor Sysoev 2009-01-19 16:42:14 +00:00
parent f39bca4281
commit cd55a93cce

View File

@ -636,8 +636,8 @@ ngx_http_geo_add_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
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);