src/http/ngx_http_upstream.c:5445: error: Integer Overflow L2
  ([0, +oo] - 5):unsigned64 by call to `ngx_http_upstream_add`.

src/http/ngx_http_upstream.c:5445:12: Call
5443.     u.no_port = 1;
5444. 
5445.     uscf = ngx_http_upstream_add(cf, &u, NGX_HTTP_UPSTREAM_CREATE
                 ^
5446.                                          |NGX_HTTP_UPSTREAM_WEIGHT
5447.                                          |NGX_HTTP_UPSTREAM_MAX_CONNS

src/http/ngx_http_upstream.c:5698:1: Parameter `u->url.len`
  5696. 
  5697. 
  5698. ngx_http_upstream_srv_conf_t *
        ^
  5699. ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
  5700. {

src/http/ngx_http_upstream.c:5708:13: Call
  5706.     if (!(flags & NGX_HTTP_UPSTREAM_CREATE)) {
  5707. 
  5708.         if (ngx_parse_url(cf->pool, u) != NGX_OK) {
                    ^
  5709.             if (u->err) {
  5710.                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,

src/core/ngx_inet.c:677:1: Parameter `u->url.len`
    675. 
    676. 
    677. ngx_int_t
         ^
    678. ngx_parse_url(ngx_pool_t *pool, ngx_url_t *u)
    679. {

src/core/ngx_inet.c:687:16: Call
    685. 
    686.     if (len >= 5 && ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) {
    687.         return ngx_parse_unix_domain_url(pool, u);
                        ^
    688.     }
    689. 

src/core/ngx_inet.c:698:1: <LHS trace>
696. 
697. 
698. static ngx_int_t
     ^
699. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)
700. {

src/core/ngx_inet.c:698:1: Parameter `u->url.len`
      696. 
      697. 
      698. static ngx_int_t
           ^
      699. ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)
      700. {

src/core/ngx_inet.c:706:5: Assignment
      704.     struct sockaddr_un  *saun;
      705. 
      706.     len = u->url.len;
               ^
      707.     path = u->url.data;
      708. 

src/core/ngx_inet.c:710:5: Binary operation: ([0, +oo] - 5):unsigned64 by call to `ngx_http_upstream_add` 
      708. 
      709.     path += 5;
      710.     len -= 5;
               ^
      711. 
      712.     if (u->uri_part) {

static ngx_int_t
ngx_parse_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)
{
#if (NGX_HAVE_UNIX_DOMAIN)
    u_char              *path, *uri, *last;
    size_t               len;
    struct sockaddr_un  *saun;
    len = u->url.len;
    path = u->url.data;
    path += 5;
    len -= 5;
    if (u->uri_part) {
        last = path + len;
        uri = ngx_strlchr(path, last, ':');
        if (uri) {
            len = uri - path;
            uri++;
            u->uri.len = last - uri;
            u->uri.data = uri;
        }
    }
    if (len == 0) {
        u->err = "no path in the unix domain socket";
        return NGX_ERROR;
    }
    u->host.len = len++;
    u->host.data = path;
    if (len > sizeof(saun->sun_path)) {
        u->err = "too long path in the unix domain socket";
        return NGX_ERROR;
    }
    u->socklen = sizeof(struct sockaddr_un);
    saun = (struct sockaddr_un *) &u->sockaddr;
    saun->sun_family = AF_UNIX;
    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);
    u->addrs = ngx_pcalloc(pool, sizeof(ngx_addr_t));
    if (u->addrs == NULL) {
        return NGX_ERROR;
    }
    saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un));
    if (saun == NULL) {
        return NGX_ERROR;
    }
    u->family = AF_UNIX;
    u->naddrs = 1;
    saun->sun_family = AF_UNIX;
    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);
    u->addrs[0].sockaddr = (struct sockaddr *) saun;
    u->addrs[0].socklen = sizeof(struct sockaddr_un);
    u->addrs[0].name.len = len + 4;
    u->addrs[0].name.data = u->url.data;
    return NGX_OK;
#else
    u->err = "the unix domain sockets are not supported on this platform";
    return NGX_ERROR;
#endif
}
['static char *\nngx_http_upstream(ngx_conf_t *cf, ngx_command_t *cmd, void *dummy)\n{\n    char                          *rv;\n    void                          *mconf;\n    ngx_str_t                     *value;\n    ngx_url_t                      u;\n    ngx_uint_t                     m;\n    ngx_conf_t                     pcf;\n    ngx_http_module_t             *module;\n    ngx_http_conf_ctx_t           *ctx, *http_ctx;\n    ngx_http_upstream_srv_conf_t  *uscf;\n    ngx_memzero(&u, sizeof(ngx_url_t));\n    value = cf->args->elts;\n    u.host = value[1];\n    u.no_resolve = 1;\n    u.no_port = 1;\n    uscf = ngx_http_upstream_add(cf, &u, NGX_HTTP_UPSTREAM_CREATE\n                                         |NGX_HTTP_UPSTREAM_WEIGHT\n                                         |NGX_HTTP_UPSTREAM_MAX_CONNS\n                                         |NGX_HTTP_UPSTREAM_MAX_FAILS\n                                         |NGX_HTTP_UPSTREAM_FAIL_TIMEOUT\n                                         |NGX_HTTP_UPSTREAM_DOWN\n                                         |NGX_HTTP_UPSTREAM_BACKUP);\n    if (uscf == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    ctx = ngx_pcalloc(cf->pool, sizeof(ngx_http_conf_ctx_t));\n    if (ctx == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    http_ctx = cf->ctx;\n    ctx->main_conf = http_ctx->main_conf;\n    ctx->srv_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);\n    if (ctx->srv_conf == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    ctx->srv_conf[ngx_http_upstream_module.ctx_index] = uscf;\n    uscf->srv_conf = ctx->srv_conf;\n    ctx->loc_conf = ngx_pcalloc(cf->pool, sizeof(void *) * ngx_http_max_module);\n    if (ctx->loc_conf == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    for (m = 0; cf->cycle->modules[m]; m++) {\n        if (cf->cycle->modules[m]->type != NGX_HTTP_MODULE) {\n            continue;\n        }\n        module = cf->cycle->modules[m]->ctx;\n        if (module->create_srv_conf) {\n            mconf = module->create_srv_conf(cf);\n            if (mconf == NULL) {\n                return NGX_CONF_ERROR;\n            }\n            ctx->srv_conf[cf->cycle->modules[m]->ctx_index] = mconf;\n        }\n        if (module->create_loc_conf) {\n            mconf = module->create_loc_conf(cf);\n            if (mconf == NULL) {\n                return NGX_CONF_ERROR;\n            }\n            ctx->loc_conf[cf->cycle->modules[m]->ctx_index] = mconf;\n        }\n    }\n    uscf->servers = ngx_array_create(cf->pool, 4,\n                                     sizeof(ngx_http_upstream_server_t));\n    if (uscf->servers == NULL) {\n        return NGX_CONF_ERROR;\n    }\n    pcf = *cf;\n    cf->ctx = ctx;\n    cf->cmd_type = NGX_HTTP_UPS_CONF;\n    rv = ngx_conf_parse(cf, NULL);\n    *cf = pcf;\n    if (rv != NGX_CONF_OK) {\n        return rv;\n    }\n    if (uscf->servers->nelts == 0) {\n        ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                           "no servers are inside upstream");\n        return NGX_CONF_ERROR;\n    }\n    return rv;\n}', 'ngx_http_upstream_srv_conf_t *\nngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)\n{\n    ngx_uint_t                      i;\n    ngx_http_upstream_server_t     *us;\n    ngx_http_upstream_srv_conf_t   *uscf, **uscfp;\n    ngx_http_upstream_main_conf_t  *umcf;\n    if (!(flags & NGX_HTTP_UPSTREAM_CREATE)) {\n        if (ngx_parse_url(cf->pool, u) != NGX_OK) {\n            if (u->err) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                                   "%s in upstream \\"%V\\"", u->err, &u->url);\n            }\n            return NULL;\n        }\n    }\n    umcf = ngx_http_conf_get_module_main_conf(cf, ngx_http_upstream_module);\n    uscfp = umcf->upstreams.elts;\n    for (i = 0; i < umcf->upstreams.nelts; i++) {\n        if (uscfp[i]->host.len != u->host.len\n            || ngx_strncasecmp(uscfp[i]->host.data, u->host.data, u->host.len)\n               != 0)\n        {\n            continue;\n        }\n        if ((flags & NGX_HTTP_UPSTREAM_CREATE)\n             && (uscfp[i]->flags & NGX_HTTP_UPSTREAM_CREATE))\n        {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "duplicate upstream \\"%V\\"", &u->host);\n            return NULL;\n        }\n        if ((uscfp[i]->flags & NGX_HTTP_UPSTREAM_CREATE) && !u->no_port) {\n            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                               "upstream \\"%V\\" may not have port %d",\n                               &u->host, u->port);\n            return NULL;\n        }\n        if ((flags & NGX_HTTP_UPSTREAM_CREATE) && !uscfp[i]->no_port) {\n            ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n                          "upstream \\"%V\\" may not have port %d in %s:%ui",\n                          &u->host, uscfp[i]->port,\n                          uscfp[i]->file_name, uscfp[i]->line);\n            return NULL;\n        }\n        if (uscfp[i]->port && u->port\n            && uscfp[i]->port != u->port)\n        {\n            continue;\n        }\n        if (uscfp[i]->default_port && u->default_port\n            && uscfp[i]->default_port != u->default_port)\n        {\n            continue;\n        }\n        if (flags & NGX_HTTP_UPSTREAM_CREATE) {\n            uscfp[i]->flags = flags;\n        }\n        return uscfp[i];\n    }\n    uscf = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_srv_conf_t));\n    if (uscf == NULL) {\n        return NULL;\n    }\n    uscf->flags = flags;\n    uscf->host = u->host;\n    uscf->file_name = cf->conf_file->file.name.data;\n    uscf->line = cf->conf_file->line;\n    uscf->port = u->port;\n    uscf->default_port = u->default_port;\n    uscf->no_port = u->no_port;\n    if (u->naddrs == 1 && (u->port || u->family == AF_UNIX)) {\n        uscf->servers = ngx_array_create(cf->pool, 1,\n                                         sizeof(ngx_http_upstream_server_t));\n        if (uscf->servers == NULL) {\n            return NULL;\n        }\n        us = ngx_array_push(uscf->servers);\n        if (us == NULL) {\n            return NULL;\n        }\n        ngx_memzero(us, sizeof(ngx_http_upstream_server_t));\n        us->addrs = u->addrs;\n        us->naddrs = 1;\n    }\n    uscfp = ngx_array_push(&umcf->upstreams);\n    if (uscfp == NULL) {\n        return NULL;\n    }\n    *uscfp = uscf;\n    return uscf;\n}', 'ngx_int_t\nngx_parse_url(ngx_pool_t *pool, ngx_url_t *u)\n{\n    u_char  *p;\n    size_t   len;\n    p = u->url.data;\n    len = u->url.len;\n    if (len >= 5 && ngx_strncasecmp(p, (u_char *) "unix:", 5) == 0) {\n        return ngx_parse_unix_domain_url(pool, u);\n    }\n    if (len && 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_unix_domain_url(ngx_pool_t *pool, ngx_url_t *u)\n{\n#if (NGX_HAVE_UNIX_DOMAIN)\n    u_char              *path, *uri, *last;\n    size_t               len;\n    struct sockaddr_un  *saun;\n    len = u->url.len;\n    path = u->url.data;\n    path += 5;\n    len -= 5;\n    if (u->uri_part) {\n        last = path + len;\n        uri = ngx_strlchr(path, last, \':\');\n        if (uri) {\n            len = uri - path;\n            uri++;\n            u->uri.len = last - uri;\n            u->uri.data = uri;\n        }\n    }\n    if (len == 0) {\n        u->err = "no path in the unix domain socket";\n        return NGX_ERROR;\n    }\n    u->host.len = len++;\n    u->host.data = path;\n    if (len > sizeof(saun->sun_path)) {\n        u->err = "too long path in the unix domain socket";\n        return NGX_ERROR;\n    }\n    u->socklen = sizeof(struct sockaddr_un);\n    saun = (struct sockaddr_un *) &u->sockaddr;\n    saun->sun_family = AF_UNIX;\n    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);\n    u->addrs = ngx_pcalloc(pool, sizeof(ngx_addr_t));\n    if (u->addrs == NULL) {\n        return NGX_ERROR;\n    }\n    saun = ngx_pcalloc(pool, sizeof(struct sockaddr_un));\n    if (saun == NULL) {\n        return NGX_ERROR;\n    }\n    u->family = AF_UNIX;\n    u->naddrs = 1;\n    saun->sun_family = AF_UNIX;\n    (void) ngx_cpystrn((u_char *) saun->sun_path, path, len);\n    u->addrs[0].sockaddr = (struct sockaddr *) saun;\n    u->addrs[0].socklen = sizeof(struct sockaddr_un);\n    u->addrs[0].name.len = len + 4;\n    u->addrs[0].name.data = u->url.data;\n    return NGX_OK;\n#else\n    u->err = "the unix domain sockets are not supported on this platform";\n    return NGX_ERROR;\n#endif\n}']