src/http/modules/ngx_http_geo_module.c:326: 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:319:9: Call
317.     ngx_array_t  *xfwd;
318. 
319.     if (ngx_http_geo_real_addr(r, ctx, addr) != NGX_OK) {
             ^
320.         return NGX_ERROR;
321.     }

src/http/modules/ngx_http_geo_module.c:351:9: Call
  349.     }
  350. 
  351.     v = ngx_http_get_flushed_variable(r, ctx->index);
               ^
  352. 
  353.     if (v == NULL || v->not_found) {

src/http/ngx_http_variables.c:553:12: Call
    551.     }
    552. 
    553.     return ngx_http_get_indexed_variable(r, index);
                    ^
    554. }
    555. 

src/http/ngx_http_variables.c:520:9: Unknown value from: non-const function
      518.     v = cmcf->variables.elts;
      519. 
      520.     if (v[index].get_handler(r, &r->variables[index], v[index].data)
                   ^
      521.         == NGX_OK)
      522.     {

src/http/modules/ngx_http_geo_module.c:326:16: Call
324. 
325.     if (xfwd->nelts > 0 && ctx->proxies != NULL) {
326.         (void) ngx_http_get_forwarded_addr(r, addr, xfwd, NULL,
                    ^
327.                                            ctx->proxies, ctx->proxy_recursive);
328.     }

src/http/ngx_http_core_module.c:2775:1: Parameter `*value->data`
  2773. 
  2774. 
  2775. ngx_int_t
        ^
  2776. ngx_http_get_forwarded_addr(ngx_http_request_t *r, ngx_addr_t *addr,
  2777.     ngx_array_t *headers, ngx_str_t *value, ngx_array_t *proxies,

src/http/ngx_http_core_module.c:2785:16: Call
  2783. 
  2784.     if (headers == NULL) {
  2785.         return ngx_http_get_forwarded_addr_internal(r, addr, value->data,
                       ^
  2786.                                                     value->len, proxies,
  2787.                                                     recursive);

src/http/ngx_http_core_module.c:2822:1: Parameter `*xff`
    2820. 
    2821. 
    2822. static ngx_int_t
          ^
    2823. ngx_http_get_forwarded_addr_internal(ngx_http_request_t *r, ngx_addr_t *addr,
    2824.     u_char *xff, size_t xfflen, ngx_array_t *proxies, int recursive)

src/http/ngx_http_core_module.c:2847:9: Call
    2845.     }
    2846. 
    2847.     if (ngx_parse_addr_port(r->pool, &paddr, p, xfflen - (p - xff)) != NGX_OK) {
                  ^
    2848.         return NGX_DECLINED;
    2849.     }

src/core/ngx_inet.c:615:1: Parameter `*text`
      613. 
      614. 
      615. ngx_int_t
           ^
      616. ngx_parse_addr_port(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text,
      617.     size_t len)

src/core/ngx_inet.c:647:13: Call
      645. 
      646.     {
      647.         p = ngx_strlchr(text, last, ':');
                       ^
      648. 
      649.         if (p == NULL) {

src/core/ngx_string.h:65:1: Parameter `c`
        63. #define ngx_strchr(s1, c)   strchr((const char *) s1, (int) c)
        64. 
        65. static ngx_inline u_char *
            ^
        66. ngx_strlchr(u_char *p, u_char *last, u_char c)
        67. {

src/core/ngx_inet.c:657:12: Call
      655.     plen = last - p;
      656. 
      657.     port = ngx_atoi(p, plen);
                      ^
      658. 
      659.     if (port < 1 || port > 65535) {

src/core/ngx_string.c:910:5: <LHS trace>
908.     }
909. 
910.     cutoff = NGX_MAX_INT_T_VALUE / 10;
         ^
911.     cutlim = NGX_MAX_INT_T_VALUE % 10;
912. 

src/core/ngx_string.c:910:5: Assignment
        908.     }
        909. 
        910.     cutoff = NGX_MAX_INT_T_VALUE / 10;
                 ^
        911.     cutlim = NGX_MAX_INT_T_VALUE % 10;
        912. 

src/core/ngx_string.c:901:1: <RHS trace>
899. 
900. 
901. ngx_int_t
     ^
902. ngx_atoi(u_char *line, size_t n)
903. {

src/core/ngx_string.c:901:1: Parameter `*line`
        899. 
        900. 
        901. ngx_int_t
             ^
        902. ngx_atoi(u_char *line, size_t n)
        903. {

src/core/ngx_string.c:922:9: Binary operation: ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_get_forwarded_addr` 
        920.         }
        921. 
        922.         value = value * 10 + (*line - '0');
                     ^
        923.     }
        924. 

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 (v[index].get_handler(r, &r->variables[index], v[index].data)\n        == NGX_OK)\n    {\n        if (v[index].flags & NGX_HTTP_VAR_NOCACHEABLE) {\n            r->variables[index].no_cacheable = 1;\n        }\n        return &r->variables[index];\n    }\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_int_t    rc;\n    ngx_addr_t   paddr;\n    if (ngx_cidr_match(addr->sockaddr, proxies) != NGX_OK) {\n        return 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)) != NGX_OK) {\n        return NGX_DECLINED;\n    }\n    *addr = paddr;\n    if (recursive && p > xff) {\n        rc = ngx_http_get_forwarded_addr_internal(r, addr, xff, p - 1 - xff,\n                                                  proxies, 1);\n        if (rc == NGX_DECLINED) {\n            return NGX_DONE;\n        }\n        return rc;\n    }\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}", 'static ngx_inline u_char *\nngx_strlchr(u_char *p, u_char *last, u_char c)\n{\n    while (p < last) {\n        if (*p == c) {\n            return p;\n        }\n        p++;\n    }\n    return NULL;\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}"]