From cd55a93cce4204a1b4ea5b16391d5ce8380f5997 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Mon, 19 Jan 2009 16:42:14 +0000 Subject: [PATCH] fix segfault when geo range replaces starting part of another range --- src/http/modules/ngx_http_geo_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c index 5535eb299..bd6499ec7 100644 --- 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, 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);