src/http/modules/ngx_http_geo_module.c:352: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned64.

src/http/modules/ngx_http_geo_module.c:334:5: <LHS trace>
332.     }
333. 
334.     name.len--;
         ^
335.     name.data++;
336. 

src/http/modules/ngx_http_geo_module.c:334:5: Assignment
332.     }
333. 
334.     name.len--;
         ^
335.     name.data++;
336. 

src/http/modules/ngx_http_geo_module.c:339:22: Call
337.     if (cf->args->nelts == 3) {
338. 
339.         geo->index = ngx_http_get_variable_index(cf, &name);
                          ^
340.         if (geo->index == NGX_ERROR) {
341.             return NGX_CONF_ERROR;

src/http/ngx_http_variables.c:395:1: Parameter `name->len`
  393. 
  394. 
  395. ngx_int_t
       ^
  396. ngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name)
  397. {

src/http/modules/ngx_http_geo_module.c:352:9: Binary operation: ([0, +oo] - 1):unsigned64
350.         }
351. 
352.         name.len--;
             ^
353.         name.data++;
354. 

static char *
ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
    char                     *rv;
    size_t                    len;
    ngx_str_t                *value, name;
    ngx_uint_t                i;
    ngx_conf_t                save;
    ngx_pool_t               *pool;
    ngx_array_t              *a;
    ngx_http_variable_t      *var;
    ngx_http_geo_ctx_t       *geo;
    ngx_http_geo_conf_ctx_t   ctx;
    value = cf->args->elts;
    geo = ngx_palloc(cf->pool, sizeof(ngx_http_geo_ctx_t));
    if (geo == NULL) {
        return NGX_CONF_ERROR;
    }
    name = value[1];
    if (name.data[0] != '$') {
        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                           "invalid variable name \"%V\"", &name);
        return NGX_CONF_ERROR;
    }
    name.len--;
    name.data++;
    if (cf->args->nelts == 3) {
        geo->index = ngx_http_get_variable_index(cf, &name);
        if (geo->index == NGX_ERROR) {
            return NGX_CONF_ERROR;
        }
        name = value[2];
        if (name.data[0] != '$') {
            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                               "invalid variable name \"%V\"", &name);
            return NGX_CONF_ERROR;
        }
        name.len--;
        name.data++;
    } else {
        geo->index = -1;
    }
    var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);
    if (var == NULL) {
        return NGX_CONF_ERROR;
    }
    pool = ngx_create_pool(16384, cf->log);
    if (pool == NULL) {
        return NGX_CONF_ERROR;
    }
    ngx_memzero(&ctx, sizeof(ngx_http_geo_conf_ctx_t));
    ctx.temp_pool = ngx_create_pool(16384, cf->log);
    if (ctx.temp_pool == NULL) {
        return NGX_CONF_ERROR;
    }
    ngx_rbtree_init(&ctx.rbtree, &ctx.sentinel, ngx_str_rbtree_insert_value);
    ctx.pool = cf->pool;
    ctx.data_size = sizeof(ngx_http_geo_header_t)
                  + sizeof(ngx_http_variable_value_t)
                  + 0x10000 * sizeof(ngx_http_geo_range_t *);
    ctx.allow_binary_include = 1;
    save = *cf;
    cf->pool = pool;
    cf->ctx = &ctx;
    cf->handler = ngx_http_geo;
    cf->handler_conf = conf;
    rv = ngx_conf_parse(cf, NULL);
    *cf = save;
    geo->proxies = ctx.proxies;
    geo->proxy_recursive = ctx.proxy_recursive;
    if (ctx.ranges) {
        if (ctx.high.low && !ctx.binary_include) {
            for (i = 0; i < 0x10000; i++) {
                a = (ngx_array_t *) ctx.high.low[i];
                if (a == NULL || a->nelts == 0) {
                    continue;
                }
                len = a->nelts * sizeof(ngx_http_geo_range_t);
                ctx.high.low[i] = ngx_palloc(cf->pool, len + sizeof(void *));
                if (ctx.high.low[i] == NULL) {
                    return NGX_CONF_ERROR;
                }
                ngx_memcpy(ctx.high.low[i], a->elts, len);
                ctx.high.low[i][a->nelts].value = NULL;
                ctx.data_size += len + sizeof(void *);
            }
            if (ctx.allow_binary_include
                && !ctx.outside_entries
                && ctx.entries > 100000
                && ctx.includes == 1)
            {
                ngx_http_geo_create_binary_base(&ctx);
            }
        }
        if (ctx.high.default_value == NULL) {
            ctx.high.default_value = &ngx_http_variable_null_value;
        }
        geo->u.high = ctx.high;
        var->get_handler = ngx_http_geo_range_variable;
        var->data = (uintptr_t) geo;
        ngx_destroy_pool(ctx.temp_pool);
        ngx_destroy_pool(pool);
    } else {
        if (ctx.tree == NULL) {
            ctx.tree = ngx_radix_tree_create(cf->pool, -1);
            if (ctx.tree == NULL) {
                return NGX_CONF_ERROR;
            }
        }
        geo->u.tree = ctx.tree;
        var->get_handler = ngx_http_geo_cidr_variable;
        var->data = (uintptr_t) geo;
        ngx_destroy_pool(ctx.temp_pool);
        ngx_destroy_pool(pool);
        if (ngx_radix32tree_find(ctx.tree, 0) != NGX_RADIX_NO_VALUE) {
            return rv;
        }
        if (ngx_radix32tree_insert(ctx.tree, 0, 0,
                                   (uintptr_t) &ngx_http_variable_null_value)
            == NGX_ERROR)
        {
            return NGX_CONF_ERROR;
        }
    }
    return rv;
}
['static char *\nngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)\n{\n    char                     *rv;\n    size_t                    len;\n    ngx_str_t                *value, name;\n    ngx_uint_t                i;\n    ngx_conf_t                save;\n    ngx_pool_t               *pool;\n    ngx_array_t              *a;\n    ngx_http_variable_t      *var;\n    ngx_http_geo_ctx_t       *geo;\n    ngx_http_geo_conf_ctx_t   ctx;\n    value = cf->args->elts;\n    geo = ngx_palloc(cf->pool, sizeof(ngx_http_geo_ctx_t));\n    if (geo == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    name = value[1];\n    if (name.data[0] != \'$\') {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid variable name \\"%V\\"", &name);\n        return NGX_CONF_ERROR;\n    }\n    name.len--;\n    name.data++;\n    if (cf->args->nelts == 3) {\n        geo->index = ngx_http_get_variable_index(cf, &name);\n        if (geo->index == NGX_ERROR) {\n            return NGX_CONF_ERROR;\n        }\n        name = value[2];\n        if (name.data[0] != \'$\') {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "invalid variable name \\"%V\\"", &name);\n            return NGX_CONF_ERROR;\n        }\n        name.len--;\n        name.data++;\n    } else {\n        geo->index = -1;\n    }\n    var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE);\n    if (var == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    pool = ngx_create_pool(16384, cf->log);\n    if (pool == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    ngx_memzero(&ctx, sizeof(ngx_http_geo_conf_ctx_t));\n    ctx.temp_pool = ngx_create_pool(16384, cf->log);\n    if (ctx.temp_pool == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    ngx_rbtree_init(&ctx.rbtree, &ctx.sentinel, ngx_str_rbtree_insert_value);\n    ctx.pool = cf->pool;\n    ctx.data_size = sizeof(ngx_http_geo_header_t)\n                  + sizeof(ngx_http_variable_value_t)\n                  + 0x10000 * sizeof(ngx_http_geo_range_t *);\n    ctx.allow_binary_include = 1;\n    save = *cf;\n    cf->pool = pool;\n    cf->ctx = &ctx;\n    cf->handler = ngx_http_geo;\n    cf->handler_conf = conf;\n    rv = ngx_conf_parse(cf, NULL);\n    *cf = save;\n    geo->proxies = ctx.proxies;\n    geo->proxy_recursive = ctx.proxy_recursive;\n    if (ctx.ranges) {\n        if (ctx.high.low && !ctx.binary_include) {\n            for (i = 0; i < 0x10000; i++) {\n                a = (ngx_array_t *) ctx.high.low[i];\n                if (a == NULL || a->nelts == 0) {\n                    continue;\n                }\n                len = a->nelts * sizeof(ngx_http_geo_range_t);\n                ctx.high.low[i] = ngx_palloc(cf->pool, len + sizeof(void *));\n                if (ctx.high.low[i] == NULL) {\n                    return NGX_CONF_ERROR;\n                }\n                ngx_memcpy(ctx.high.low[i], a->elts, len);\n                ctx.high.low[i][a->nelts].value = NULL;\n                ctx.data_size += len + sizeof(void *);\n            }\n            if (ctx.allow_binary_include\n                && !ctx.outside_entries\n                && ctx.entries > 100000\n                && ctx.includes == 1)\n            {\n                ngx_http_geo_create_binary_base(&ctx);\n            }\n        }\n        if (ctx.high.default_value == NULL) {\n            ctx.high.default_value = &ngx_http_variable_null_value;\n        }\n        geo->u.high = ctx.high;\n        var->get_handler = ngx_http_geo_range_variable;\n        var->data = (uintptr_t) geo;\n        ngx_destroy_pool(ctx.temp_pool);\n        ngx_destroy_pool(pool);\n    } else {\n        if (ctx.tree == NULL) {\n            ctx.tree = ngx_radix_tree_create(cf->pool, -1);\n            if (ctx.tree == NULL) {\n                return NGX_CONF_ERROR;\n            }\n        }\n        geo->u.tree = ctx.tree;\n        var->get_handler = ngx_http_geo_cidr_variable;\n        var->data = (uintptr_t) geo;\n        ngx_destroy_pool(ctx.temp_pool);\n        ngx_destroy_pool(pool);\n        if (ngx_radix32tree_find(ctx.tree, 0) != NGX_RADIX_NO_VALUE) {\n            return rv;\n        }\n        if (ngx_radix32tree_insert(ctx.tree, 0, 0,\n                                   (uintptr_t) &ngx_http_variable_null_value)\n            == NGX_ERROR)\n        {\n            return NGX_CONF_ERROR;\n        }\n    }\n    return rv;\n}', 'ngx_int_t\nngx_http_get_variable_index(ngx_conf_t *cf, ngx_str_t *name)\n{\n    ngx_uint_t                  i;\n    ngx_http_variable_t        *v;\n    ngx_http_core_main_conf_t  *cmcf;\n    if (name->len == 0) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "invalid variable name \\"$\\"");\n        return NGX_ERROR;\n    }\n    cmcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_core_module);\n    v = cmcf->variables.elts;\n    if (v == NULL) {\n        if (ngx_array_init(&cmcf->variables, cf->pool, 4,\n                           sizeof(ngx_http_variable_t))\n            != NGX_OK)\n        {\n            return NGX_ERROR;\n        }\n    } else {\n        for (i = 0; i < cmcf->variables.nelts; i++) {\n            if (name->len != v[i].name.len\n                || ngx_strncasecmp(name->data, v[i].name.data, name->len) != 0)\n            {\n                continue;\n            }\n            return i;\n        }\n    }\n    v = ngx_array_push(&cmcf->variables);\n    if (v == NULL) {\n        return NGX_ERROR;\n    }\n    v->name.len = name->len;\n    v->name.data = ngx_pnalloc(cf->pool, name->len);\n    if (v->name.data == NULL) {\n        return NGX_ERROR;\n    }\n    ngx_strlow(v->name.data, name->data, name->len);\n    v->set_handler = NULL;\n    v->get_handler = NULL;\n    v->data = 0;\n    v->flags = 0;\n    v->index = cmcf->variables.nelts - 1;\n    return v->index;\n}']