src/http/ngx_http_core_module.c:2798: error: Integer Overflow L2
  ([0, 9223372036854775800] + [0, 9]):signed64 by call to `ngx_http_get_forwarded_addr_internal`.

src/http/ngx_http_core_module.c:2798:14: Call
2796. 
2797.     while (i-- > 0) {
2798.         rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,
                   ^
2799.                                                   h[i]->value.len, proxies,
2800.                                                   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:2798:14: Call
2796. 
2797.     while (i-- > 0) {
2798.         rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,
                   ^
2799.                                                   h[i]->value.len, proxies,
2800.                                                   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:2798:14: Call
2796. 
2797.     while (i-- > 0) {
2798.         rc = ngx_http_get_forwarded_addr_internal(r, addr, h[i]->value.data,
                   ^
2799.                                                   h[i]->value.len, proxies,
2800.                                                   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:2913:13: Call
  2911.         }
  2912. 
  2913.         if (ngx_parse_addr_port(r->pool, &paddr, p, xfflen - (p - xff))
                    ^
  2914.             != NGX_OK)
  2915.         {

src/core/ngx_inet.c:528:1: Parameter `*text`
    526. 
    527. 
    528. ngx_int_t
         ^
    529. ngx_parse_addr_port(ngx_pool_t *pool, ngx_addr_t *addr, u_char *text,
    530.     size_t len)

src/core/ngx_inet.c:564:13: Call
    562. 
    563.     {
    564.         p = ngx_strlchr(text, last, ':');
                     ^
    565. 
    566.         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:574:12: Call
    572.     plen = last - p;
    573. 
    574.     port = ngx_atoi(p, plen);
                    ^
    575. 
    576.     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_internal` 
      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;
}
['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    in_addr_t         inaddr;\n    ngx_int_t         rc;\n    ngx_addr_t        paddr;\n    ngx_cidr_t       *cidr;\n    ngx_uint_t        family, i;\n#if (NGX_HAVE_INET6)\n    ngx_uint_t        n;\n    struct in6_addr  *inaddr6;\n#endif\n#if (NGX_SUPPRESS_WARN)\n    inaddr = 0;\n#if (NGX_HAVE_INET6)\n    inaddr6 = NULL;\n#endif\n#endif\n    family = addr->sockaddr->sa_family;\n    if (family == AF_INET) {\n        inaddr = ((struct sockaddr_in *) addr->sockaddr)->sin_addr.s_addr;\n    }\n#if (NGX_HAVE_INET6)\n    else if (family == AF_INET6) {\n        inaddr6 = &((struct sockaddr_in6 *) addr->sockaddr)->sin6_addr;\n        if (IN6_IS_ADDR_V4MAPPED(inaddr6)) {\n            family = AF_INET;\n            p = inaddr6->s6_addr;\n            inaddr = p[12] << 24;\n            inaddr += p[13] << 16;\n            inaddr += p[14] << 8;\n            inaddr += p[15];\n            inaddr = htonl(inaddr);\n        }\n    }\n#endif\n    for (cidr = proxies->elts, i = 0; i < proxies->nelts; i++) {\n        if (cidr[i].family != family) {\n            goto next;\n        }\n        switch (family) {\n#if (NGX_HAVE_INET6)\n        case AF_INET6:\n            for (n = 0; n < 16; n++) {\n                if ((inaddr6->s6_addr[n] & cidr[i].u.in6.mask.s6_addr[n])\n                    != cidr[i].u.in6.addr.s6_addr[n])\n                {\n                    goto next;\n                }\n            }\n            break;\n#endif\n#if (NGX_HAVE_UNIX_DOMAIN)\n        case AF_UNIX:\n            break;\n#endif\n        default:\n            if ((inaddr & cidr[i].u.in.mask) != cidr[i].u.in.addr) {\n                goto next;\n            }\n            break;\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 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    next:\n        continue;\n    }\n    return NGX_DECLINED;\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    struct sockaddr_in   *sin;\n#if (NGX_HAVE_INET6)\n    struct sockaddr_in6  *sin6;\n#endif\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    switch (addr->sockaddr->sa_family) {\n#if (NGX_HAVE_INET6)\n    case AF_INET6:\n        sin6 = (struct sockaddr_in6 *) addr->sockaddr;\n        sin6->sin6_port = htons(port);\n        break;\n#endif\n    default:\n        sin = (struct sockaddr_in *) addr->sockaddr;\n        sin->sin_port = htons(port);\n        break;\n    }\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}"]