src/http/modules/ngx_http_geo_module.c:339: error: Integer Overflow L2
  ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_get_forwarded_addr`.

src/http/modules/ngx_http_geo_module.c:332:9: Call
330.     ngx_array_t  *xfwd;
331. 
332.     if (ngx_http_geo_real_addr(r, ctx, addr) != NGX_OK) {
             ^
333.         return NGX_ERROR;
334.     }

src/http/modules/ngx_http_geo_module.c:364:9: Call
  362.     }
  363. 
  364.     v = ngx_http_get_flushed_variable(r, ctx->index);
               ^
  365. 
  366.     if (v == NULL || v->not_found) {

src/http/ngx_http_variables.c:665:12: Call
    663.     }
    664. 
    665.     return ngx_http_get_indexed_variable(r, index);
                    ^
    666. }
    667. 

src/http/ngx_http_variables.c:628:9: Unknown value from: non-const function
      626.     ngx_http_variable_depth--;
      627. 
      628.     if (v[index].get_handler(r, &r->variables[index], v[index].data)
                   ^
      629.         == NGX_OK)
      630.     {

src/http/modules/ngx_http_geo_module.c:339:16: Call
337. 
338.     if (xfwd->nelts > 0 && ctx->proxies != NULL) {
339.         (void) ngx_http_get_forwarded_addr(r, addr, xfwd, NULL,
                    ^
340.                                            ctx->proxies, ctx->proxy_recursive);
341.     }

src/http/ngx_http_core_module.c:2618:1: Parameter `*value->data`
  2616. 
  2617. 
  2618. ngx_int_t
        ^
  2619. ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,
  2620.     ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,

src/http/ngx_http_core_module.c:2628:16: Call
  2626. 
  2627.     if (headers == NULL) {
  2628.         return ngx_http_get_forwarded_addr_internal(r, addr, value->data,
                       ^
  2629.                                                     value->len, proxies,
  2630.                                                     recursive);

src/http/ngx_http_core_module.c:2665:1: Parameter `*xff`
    2663. 
    2664. 
    2665. static ngx_int_t
          ^
    2666. ngx_http_get_forwarded_addr_internal(ngx_http_request_t *r, ngx_addr_t *addr,
    2667.     u_char *xff, size_t xfflen, ngx_array_t *proxies, int recursive)

src/http/ngx_http_core_module.c:2694:13: Call
    2692.         }
    2693. 
    2694.         if (ngx_parse_addr_port(r->pool, &paddr, p, xfflen - (p - xff))
                      ^
    2695.             != NGX_OK)
    2696.         {

src/core/ngx_inet.c:621:1: Parameter `*text`
      619. 
      620. 
      621. ngx_int_t
           ^
      622. ngx_parse_addr_port(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text,
      623.     size_t len)

src/core/ngx_inet.c:629:10: Call
      627.     ngx_int_t   rc, port;
      628. 
      629.     rc = ngx_parse_addr(pool, addr, text, len);
                    ^
      630. 
      631.     if (rc != NGX_DECLINED) {

src/core/ngx_inet.c:561:1: Parameter `*text`
        559. 
        560. 
        561. ngx_int_t
             ^
        562. ngx_parse_addr(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text, size_t len)
        563. {

src/core/ngx_inet.c:663:12: Call
      661.     plen = last - p;
      662. 
      663.     port = ngx_atoi(p, plen);
                      ^
      664. 
      665.     if (port < 1 || port > 65535) {

src/core/ngx_string.c:926:5: <LHS trace>
924.     }
925. 
926.     cutoff = NGX_MAX_INT_T_VALUE / 10;
         ^
927.     cutlim = NGX_MAX_INT_T_VALUE % 10;
928. 

src/core/ngx_string.c:926:5: Assignment
        924.     }
        925. 
        926.     cutoff = NGX_MAX_INT_T_VALUE / 10;
                 ^
        927.     cutlim = NGX_MAX_INT_T_VALUE % 10;
        928. 

src/core/ngx_string.c:917:1: <RHS trace>
915. 
916. 
917. ngx_int_t
     ^
918. ngx_atoi(u_char *line, size_t n)
919. {

src/core/ngx_string.c:917:1: Parameter `*line`
        915. 
        916. 
        917. ngx_int_t
             ^
        918. ngx_atoi(u_char *line, size_t n)
        919. {

src/core/ngx_string.c:938:9: Binary operation: ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_get_forwarded_addr` 
        936.         }
        937. 
        938.         value = value * 10 + (*line - '0');
                     ^
        939.     }
        940. 

ngx_int_t
ngx_atoi(u_char *line, size_t n)
{
    ngx_int_t  value, cutoff, cutlim;
    if (n == 0) {
        return NGX_ERROR;
    }
    cutoff = NGX_MAX_INT_T_VALUE / 10;
    cutlim = NGX_MAX_INT_T_VALUE % 10;
    for (value = 0; n--; line++) {
        if (*line < '0' || *line > '9') {
            return NGX_ERROR;
        }
        if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {
            return NGX_ERROR;
        }
        value = value * 10 + (*line - '0');
    }
    return value;
}
['static ngx_int_t\nngx_http_geo_addr(ngx_http_request_t *r, ngx_http_geo_ctx_t *ctx,\n    ngx_addr_t *addr)\n{\n    ngx_array_t  *xfwd;\n    if (ngx_http_geo_real_addr(r, ctx, addr) != NGX_OK) {\n        return NGX_ERROR;\n    }\n    xfwd = &r->headers_in.x_forwarded_for;\n    if (xfwd->nelts > 0 && ctx->proxies != NULL) {\n        (void) ngx_http_get_forwarded_addr(r, addr, xfwd, NULL,\n                                           ctx->proxies, ctx->proxy_recursive);\n    }\n    return NGX_OK;\n}', 'static ngx_int_t\nngx_http_geo_real_addr(ngx_http_request_t *r, ngx_http_geo_ctx_t *ctx,\n    ngx_addr_t *addr)\n{\n    ngx_http_variable_value_t  *v;\n    if (ctx->index == -1) {\n        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                       "http geo started: %V", &r->connection->addr_text);\n        addr->sockaddr = r->connection->sockaddr;\n        addr->socklen = r->connection->socklen;\n        return NGX_OK;\n    }\n    v = ngx_http_get_flushed_variable(r, ctx->index);\n    if (v == NULL || v->not_found) {\n        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                       "http geo not found");\n        return NGX_ERROR;\n    }\n    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "http geo started: %v", v);\n    if (ngx_parse_addr(r->pool, addr, v->data, v->len) == NGX_OK) {\n        return NGX_OK;\n    }\n    return NGX_ERROR;\n}', 'ngx_http_variable_value_t *\nngx_http_get_flushed_variable(ngx_http_request_t *r, ngx_uint_t index)\n{\n    ngx_http_variable_value_t  *v;\n    v = &r->variables[index];\n    if (v->valid || v->not_found) {\n        if (!v->no_cacheable) {\n            return v;\n        }\n        v->valid = 0;\n        v->not_found = 0;\n    }\n    return ngx_http_get_indexed_variable(r, index);\n}', 'ngx_http_variable_value_t *\nngx_http_get_indexed_variable(ngx_http_request_t *r, ngx_uint_t index)\n{\n    ngx_http_variable_t        *v;\n    ngx_http_core_main_conf_t  *cmcf;\n    cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);\n    if (cmcf->variables.nelts <= index) {\n        ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,\n                      "unknown variable index: %ui", index);\n        return NULL;\n    }\n    if (r->variables[index].not_found || r->variables[index].valid) {\n        return &r->variables[index];\n    }\n    v = cmcf->variables.elts;\n    if (ngx_http_variable_depth == 0) {\n        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                      "cycle while evaluating variable \\"%V\\"",\n                      &v[index].name);\n        return NULL;\n    }\n    ngx_http_variable_depth--;\n    if (v[index].get_handler(r, &r->variables[index], v[index].data)\n        == NGX_OK)\n    {\n        ngx_http_variable_depth++;\n        if (v[index].flags & NGX_HTTP_VAR_NOCACHEABLE) {\n            r->variables[index].no_cacheable = 1;\n        }\n        return &r->variables[index];\n    }\n    ngx_http_variable_depth++;\n    r->variables[index].valid = 0;\n    r->variables[index].not_found = 1;\n    return NULL;\n}', 'ngx_int_t\nngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,\n    ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,\n    int recursive)\n{\n    ngx_int_t          rc;\n    ngx_uint_t         i, found;\n    ngx_table_elt_t  **h;\n    if (headers == NULL) {\n        return ngx_http_get_forwarded_addr_internal(r, addr, value->data,\n                                                    value->len, proxies,\n                                                    recursive);\n    }\n    i = headers->nelts;\n    h = headers->elts;\n    rc = NGX_DECLINED;\n    found = 0;\n    while (i-- > 0) {\n        rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,\n                                                  h[i]->value.len, proxies,\n                                                  recursive);\n        if (!recursive) {\n            break;\n        }\n        if (rc == NGX_DECLINED && found) {\n            rc = NGX_DONE;\n            break;\n        }\n        if (rc != NGX_OK) {\n            break;\n        }\n        found = 1;\n    }\n    return rc;\n}', "static ngx_int_t\nngx_http_get_forwarded_addr_internal(ngx_http_request_t *r, ngx_addr_t *addr,\n    u_char *xff, size_t xfflen, ngx_array_t *proxies, int recursive)\n{\n    u_char      *p;\n    ngx_addr_t   paddr;\n    ngx_uint_t   found;\n    found = 0;\n    do {\n        if (ngx_cidr_match(addr->sockaddr, proxies) != NGX_OK) {\n            return found ? NGX_DONE : NGX_DECLINED;\n        }\n        for (p = xff + xfflen - 1; p > xff; p--, xfflen--) {\n            if (*p != ' ' && *p != ',') {\n                break;\n            }\n        }\n        for (   ; p > xff; p--) {\n            if (*p == ' ' || *p == ',') {\n                p++;\n                break;\n            }\n        }\n        if (ngx_parse_addr_port(r->pool, &paddr, p, xfflen - (p - xff))\n            != NGX_OK)\n        {\n            return found ? NGX_DONE : NGX_DECLINED;\n        }\n        *addr = paddr;\n        found = 1;\n        xfflen = p - 1 - xff;\n    } while (recursive && p > xff);\n    return NGX_OK;\n}", "ngx_int_t\nngx_parse_addr_port(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text,\n    size_t len)\n{\n    u_char     *p, *last;\n    size_t      plen;\n    ngx_int_t   rc, port;\n    rc = ngx_parse_addr(pool, addr, text, len);\n    if (rc != NGX_DECLINED) {\n        return rc;\n    }\n    last = text + len;\n#if (NGX_HAVE_INET6)\n    if (len && text[0] == '[') {\n        p = ngx_strlchr(text, last, ']');\n        if (p == NULL || p == last - 1 || *++p != ':') {\n            return NGX_DECLINED;\n        }\n        text++;\n        len -= 2;\n    } else\n#endif\n    {\n        p = ngx_strlchr(text, last, ':');\n        if (p == NULL) {\n            return NGX_DECLINED;\n        }\n    }\n    p++;\n    plen = last - p;\n    port = ngx_atoi(p, plen);\n    if (port < 1 || port > 65535) {\n        return NGX_DECLINED;\n    }\n    len -= plen + 1;\n    rc = ngx_parse_addr(pool, addr, text, len);\n    if (rc != NGX_OK) {\n        return rc;\n    }\n    ngx_inet_set_port(addr->sockaddr, (in_port_t) port);\n    return NGX_OK;\n}", 'ngx_int_t\nngx_parse_addr(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text, size_t len)\n{\n    in_addr_t             inaddr;\n    ngx_uint_t            family;\n    struct sockaddr_in   *sin;\n#if (NGX_HAVE_INET6)\n    struct in6_addr       inaddr6;\n    struct sockaddr_in6  *sin6;\n    ngx_memzero(&inaddr6, sizeof(struct in6_addr));\n#endif\n    inaddr = ngx_inet_addr(text, len);\n    if (inaddr != INADDR_NONE) {\n        family = AF_INET;\n        len = sizeof(struct sockaddr_in);\n#if (NGX_HAVE_INET6)\n    } else if (ngx_inet6_addr(text, len, inaddr6.s6_addr) == NGX_OK) {\n        family = AF_INET6;\n        len = sizeof(struct sockaddr_in6);\n#endif\n    } else {\n        return NGX_DECLINED;\n    }\n    addr->sockaddr = ngx_pcalloc(pool, len);\n    if (addr->sockaddr == NULL) {\n        return NGX_ERROR;\n    }\n    addr->sockaddr->sa_family = (u_char) family;\n    addr->socklen = len;\n    switch (family) {\n#if (NGX_HAVE_INET6)\n    case AF_INET6:\n        sin6 = (struct sockaddr_in6 *) addr->sockaddr;\n        ngx_memcpy(sin6->sin6_addr.s6_addr, inaddr6.s6_addr, 16);\n        break;\n#endif\n    default:\n        sin = (struct sockaddr_in *) addr->sockaddr;\n        sin->sin_addr.s_addr = inaddr;\n        break;\n    }\n    return NGX_OK;\n}', "ngx_int_t\nngx_atoi(u_char *line, size_t n)\n{\n    ngx_int_t  value, cutoff, cutlim;\n    if (n == 0) {\n        return NGX_ERROR;\n    }\n    cutoff = NGX_MAX_INT_T_VALUE / 10;\n    cutlim = NGX_MAX_INT_T_VALUE % 10;\n    for (value = 0; n--; line++) {\n        if (*line < '0' || *line > '9') {\n            return NGX_ERROR;\n        }\n        if (value >= cutoff && (value > cutoff || *line - '0' > cutlim)) {\n            return NGX_ERROR;\n        }\n        value = value * 10 + (*line - '0');\n    }\n    return value;\n}"]