src/http/modules/ngx_http_uwsgi_module.c:656: error: Integer Overflow L2
  ([-1, +oo] - 1):unsigned64 by call to `ngx_parse_url`.

src/http/modules/ngx_http_uwsgi_module.c:622:9: Assignment
620.         && ngx_strncasecmp(url.url.data, (u_char *) "uwsgi://", 8) == 0)
621.     {
622.         add = 8;
             ^
623. 
624.     } else if (url.url.len > 9

src/http/modules/ngx_http_uwsgi_module.c:647:9: Assignment
645.         u->schema.data = url.url.data;
646. 
647.         url.url.data += add;
             ^
648.         url.url.len -= add;
649. 

src/http/modules/ngx_http_uwsgi_module.c:656:9: Call
654.     url.no_resolve = 1;
655. 
656.     if (ngx_parse_url(r->pool, &url) != NGX_OK) {
             ^
657.         if (url.err) {
658.             ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,

src/core/ngx_inet.c:524:1: Parameter `*u->url.data`
  522. 
  523. 
  524. ngx_int_t
       ^
  525. ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u)
  526. {

src/core/ngx_inet.c:539:12: Call
  537.     }
  538. 
  539.     return ngx_parse_inet_url(pool, u);
                  ^
  540. }
  541. 

src/core/ngx_inet.c:621:1: <LHS trace>
619. 
620. 
621. static ngx_int_t
     ^
622. ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
623. {

src/core/ngx_inet.c:621:1: Parameter `*u->url.data`
    619. 
    620. 
    621. static ngx_int_t
         ^
    622. ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
    623. {

src/core/ngx_inet.c:638:5: Assignment
    636.     u->family = AF_INET;
    637. 
    638.     host = u->url.data;
             ^
    639. 
    640.     last = host + u->url.len;

src/core/ngx_inet.c:724:5: Assignment
    722.     }
    723. 
    724.     len = last - host;
             ^
    725. 
    726.     if (len == 0) {

src/core/ngx_inet.c:731:5: Assignment
    729.     }
    730. 
    731.     u->host.len = len;
             ^
    732.     u->host.data = host;
    733. 

src/core/ngx_inet.c:765:13: Binary operation: ([-1, +oo] - 1):unsigned64 by call to `ngx_parse_url` 
    763.         u->addrs[0].socklen = sizeof(struct sockaddr_in);
    764. 
    765.         p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
                     ^
    766.         if (p == NULL) {
    767.             return NGX_ERROR;

static ngx_int_t
ngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)
{
    u_char               *p, *host, *port, *last, *uri, *args;
    size_t                len;
    ngx_int_t             n;
    struct sockaddr_in   *sin;
#if (NGX_HAVE_INET6)
    struct sockaddr_in6  *sin6;
#endif
    u->socklen = sizeof(struct sockaddr_in);
    sin = (struct sockaddr_in *) &u->sockaddr;
    sin->sin_family = AF_INET;
    u->family = AF_INET;
    host = u->url.data;
    last = host + u->url.len;
    port = ngx_strlchr(host, last, ':');
    uri = ngx_strlchr(host, last, '/');
    args = ngx_strlchr(host, last, '?');
    if (args) {
        if (uri == NULL || args < uri) {
            uri = args;
        }
    }
    if (uri) {
        if (u->listen || !u->uri_part) {
            u->err = "invalid host";
            return NGX_ERROR;
        }
        u->uri.len = last - uri;
        u->uri.data = uri;
        last = uri;
        if (uri < port) {
            port = NULL;
        }
    }
    if (port) {
        port++;
        len = last - port;
        n = ngx_atoi(port, len);
        if (n < 1 || n > 65535) {
            u->err = "invalid port";
            return NGX_ERROR;
        }
        u->port = (in_port_t) n;
        sin->sin_port = htons((in_port_t) n);
        u->port_text.len = len;
        u->port_text.data = port;
        last = port - 1;
    } else {
        if (uri == NULL) {
            if (u->listen) {
                n = ngx_atoi(host, last - host);
                if (n != NGX_ERROR) {
                    if (n < 1 || n > 65535) {
                        u->err = "invalid port";
                        return NGX_ERROR;
                    }
                    u->port = (in_port_t) n;
                    sin->sin_port = htons((in_port_t) n);
                    u->port_text.len = last - host;
                    u->port_text.data = host;
                    u->wildcard = 1;
                    return NGX_OK;
                }
            }
        }
        u->no_port = 1;
        u->port = u->default_port;
        sin->sin_port = htons(u->default_port);
    }
    len = last - host;
    if (len == 0) {
        u->err = "no host";
        return NGX_ERROR;
    }
    u->host.len = len;
    u->host.data = host;
    if (u->listen && len == 1 && *host == '*') {
        sin->sin_addr.s_addr = INADDR_ANY;
        u->wildcard = 1;
        return NGX_OK;
    }
    sin->sin_addr.s_addr = ngx_inet_addr(host, len);
    if (sin->sin_addr.s_addr != INADDR_NONE) {
        if (sin->sin_addr.s_addr == INADDR_ANY) {
            u->wildcard = 1;
        }
        u->naddrs = 1;
        u->addrs = ngx_pcalloc(pool, sizeof(ngx_addr_t));
        if (u->addrs == NULL) {
            return NGX_ERROR;
        }
        sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in));
        if (sin == NULL) {
            return NGX_ERROR;
        }
        ngx_memcpy(sin, u->sockaddr, sizeof(struct sockaddr_in));
        u->addrs[0].sockaddr = (struct sockaddr *) sin;
        u->addrs[0].socklen = sizeof(struct sockaddr_in);
        p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
        if (p == NULL) {
            return NGX_ERROR;
        }
        u->addrs[0].name.len = ngx_sprintf(p, "%V:%d",
                                           &u->host, u->port) - p;
        u->addrs[0].name.data = p;
        return NGX_OK;
    }
    if (u->no_resolve) {
        return NGX_OK;
    }
    if (ngx_inet_resolve_host(pool, u) != NGX_OK) {
        return NGX_ERROR;
    }
    u->family = u->addrs[0].sockaddr->sa_family;
    u->socklen = u->addrs[0].socklen;
    ngx_memcpy(u->sockaddr, u->addrs[0].sockaddr, u->addrs[0].socklen);
    switch (u->family) {
#if (NGX_HAVE_INET6)
    case AF_INET6:
        sin6 = (struct sockaddr_in6 *) &u->sockaddr;
        if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {
            u->wildcard = 1;
        }
        break;
#endif
    default:
        sin = (struct sockaddr_in *) &u->sockaddr;
        if (sin->sin_addr.s_addr == INADDR_ANY) {
            u->wildcard = 1;
        }
        break;
    }
    return NGX_OK;
}
['static ngx_int_t\nngx_http_uwsgi_eval(ngx_http_request_t *r, ngx_http_uwsgi_loc_conf_t * uwcf)\n{\n    size_t                add;\n    ngx_url_t             url;\n    ngx_http_upstream_t  *u;\n    ngx_memzero(&url, sizeof(ngx_url_t));\n    if (ngx_http_script_run(r, &url.url, uwcf->uwsgi_lengths->elts, 0,\n                            uwcf->uwsgi_values->elts)\n        == NULL)\n    {\n        return NGX_ERROR;\n    }\n    if (url.url.len > 8\n        && ngx_strncasecmp(url.url.data, (u_char *) "uwsgi://", 8) == 0)\n    {\n        add = 8;\n    } else if (url.url.len > 9\n               && ngx_strncasecmp(url.url.data, (u_char *) "suwsgi://", 9) == 0)\n    {\n#if (NGX_HTTP_SSL)\n        add = 9;\n        r->upstream->ssl = 1;\n#else\n        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                      "suwsgi protocol requires SSL support");\n        return NGX_ERROR;\n#endif\n    } else {\n        add = 0;\n    }\n    u = r->upstream;\n    if (add) {\n        u->schema.len = add;\n        u->schema.data = url.url.data;\n        url.url.data += add;\n        url.url.len -= add;\n    } else {\n        ngx_str_set(&u->schema, "uwsgi://");\n    }\n    url.no_resolve = 1;\n    if (ngx_parse_url(r->pool, &url) != NGX_OK) {\n        if (url.err) {\n            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                          "%s in upstream \\"%V\\"", url.err, &url.url);\n        }\n        return NGX_ERROR;\n    }\n    u->resolved = ngx_pcalloc(r->pool, sizeof(ngx_http_upstream_resolved_t));\n    if (u->resolved == NULL) {\n        return NGX_ERROR;\n    }\n    if (url.addrs && url.addrs[0].sockaddr) {\n        u->resolved->sockaddr = url.addrs[0].sockaddr;\n        u->resolved->socklen = url.addrs[0].socklen;\n        u->resolved->naddrs = 1;\n        u->resolved->host = url.addrs[0].name;\n    } else {\n        u->resolved->host = url.host;\n        u->resolved->port = url.port;\n        u->resolved->no_port = url.no_port;\n    }\n    return NGX_OK;\n}', 'ngx_int_t\nngx_parse_url(ngx_pool_t *pool, ngx_url_t *u)\n{\n    u_char  *p;\n    p = u->url.data;\n    if (ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) {\n        return ngx_parse_unix_domain_url(pool, u);\n    }\n    if (p[0] == \'[\') {\n        return ngx_parse_inet6_url(pool, u);\n    }\n    return ngx_parse_inet_url(pool, u);\n}', 'static ngx_int_t\nngx_parse_inet_url(ngx_pool_t *pool, ngx_url_t *u)\n{\n    u_char               *p, *host, *port, *last, *uri, *args;\n    size_t                len;\n    ngx_int_t             n;\n    struct sockaddr_in   *sin;\n#if (NGX_HAVE_INET6)\n    struct sockaddr_in6  *sin6;\n#endif\n    u->socklen = sizeof(struct sockaddr_in);\n    sin = (struct sockaddr_in *) &u->sockaddr;\n    sin->sin_family = AF_INET;\n    u->family = AF_INET;\n    host = u->url.data;\n    last = host + u->url.len;\n    port = ngx_strlchr(host, last, \':\');\n    uri = ngx_strlchr(host, last, \'/\');\n    args = ngx_strlchr(host, last, \'?\');\n    if (args) {\n        if (uri == NULL || args < uri) {\n            uri = args;\n        }\n    }\n    if (uri) {\n        if (u->listen || !u->uri_part) {\n            u->err = "invalid host";\n            return NGX_ERROR;\n        }\n        u->uri.len = last - uri;\n        u->uri.data = uri;\n        last = uri;\n        if (uri < port) {\n            port = NULL;\n        }\n    }\n    if (port) {\n        port++;\n        len = last - port;\n        n = ngx_atoi(port, len);\n        if (n < 1 || n > 65535) {\n            u->err = "invalid port";\n            return NGX_ERROR;\n        }\n        u->port = (in_port_t) n;\n        sin->sin_port = htons((in_port_t) n);\n        u->port_text.len = len;\n        u->port_text.data = port;\n        last = port - 1;\n    } else {\n        if (uri == NULL) {\n            if (u->listen) {\n                n = ngx_atoi(host, last - host);\n                if (n != NGX_ERROR) {\n                    if (n < 1 || n > 65535) {\n                        u->err = "invalid port";\n                        return NGX_ERROR;\n                    }\n                    u->port = (in_port_t) n;\n                    sin->sin_port = htons((in_port_t) n);\n                    u->port_text.len = last - host;\n                    u->port_text.data = host;\n                    u->wildcard = 1;\n                    return NGX_OK;\n                }\n            }\n        }\n        u->no_port = 1;\n        u->port = u->default_port;\n        sin->sin_port = htons(u->default_port);\n    }\n    len = last - host;\n    if (len == 0) {\n        u->err = "no host";\n        return NGX_ERROR;\n    }\n    u->host.len = len;\n    u->host.data = host;\n    if (u->listen && len == 1 && *host == \'*\') {\n        sin->sin_addr.s_addr = INADDR_ANY;\n        u->wildcard = 1;\n        return NGX_OK;\n    }\n    sin->sin_addr.s_addr = ngx_inet_addr(host, len);\n    if (sin->sin_addr.s_addr != INADDR_NONE) {\n        if (sin->sin_addr.s_addr == INADDR_ANY) {\n            u->wildcard = 1;\n        }\n        u->naddrs = 1;\n        u->addrs = ngx_pcalloc(pool, sizeof(ngx_addr_t));\n        if (u->addrs == NULL) {\n            return NGX_ERROR;\n        }\n        sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in));\n        if (sin == NULL) {\n            return NGX_ERROR;\n        }\n        ngx_memcpy(sin, u->sockaddr, sizeof(struct sockaddr_in));\n        u->addrs[0].sockaddr = (struct sockaddr *) sin;\n        u->addrs[0].socklen = sizeof(struct sockaddr_in);\n        p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);\n        if (p == NULL) {\n            return NGX_ERROR;\n        }\n        u->addrs[0].name.len = ngx_sprintf(p, "%V:%d",\n                                           &u->host, u->port) - p;\n        u->addrs[0].name.data = p;\n        return NGX_OK;\n    }\n    if (u->no_resolve) {\n        return NGX_OK;\n    }\n    if (ngx_inet_resolve_host(pool, u) != NGX_OK) {\n        return NGX_ERROR;\n    }\n    u->family = u->addrs[0].sockaddr->sa_family;\n    u->socklen = u->addrs[0].socklen;\n    ngx_memcpy(u->sockaddr, u->addrs[0].sockaddr, u->addrs[0].socklen);\n    switch (u->family) {\n#if (NGX_HAVE_INET6)\n    case AF_INET6:\n        sin6 = (struct sockaddr_in6 *) &u->sockaddr;\n        if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) {\n            u->wildcard = 1;\n        }\n        break;\n#endif\n    default:\n        sin = (struct sockaddr_in *) &u->sockaddr;\n        if (sin->sin_addr.s_addr == INADDR_ANY) {\n            u->wildcard = 1;\n        }\n        break;\n    }\n    return NGX_OK;\n}']