src/http/ngx_http.c:1212: error: Integer Overflow L2
  ([0, +oo] - 2):unsigned64 by call to `ngx_cmp_sockaddr`.

src/http/ngx_http.c:1212:13: Call
1210.     for (i = 0; i < port->addrs.nelts; i++) {
1211. 
1212.         if (ngx_cmp_sockaddr(&lsopt->sockaddr.sockaddr, lsopt->socklen,
                  ^
1213.                              &addr[i].opt.sockaddr.sockaddr,
1214.                              addr[i].opt.socklen, 0)

src/core/ngx_inet.c:1358:1: <LHS trace>
1356. 
1357. 
1358. ngx_int_t
      ^
1359. ngx_cmp_sockaddr(struct sockaddr *sa1, socklen_t slen1,
1360.     struct sockaddr *sa2, socklen_t slen2, ngx_uint_t cmp_port)

src/core/ngx_inet.c:1358:1: Parameter `slen2`
  1356. 
  1357. 
  1358. ngx_int_t
        ^
  1359. ngx_cmp_sockaddr(struct sockaddr *sa1, socklen_t slen1,
  1360.     struct sockaddr *sa2, socklen_t slen2, ngx_uint_t cmp_port)

src/core/ngx_inet.c:1404:13: Binary operation: ([0, +oo] - 2):unsigned64 by call to `ngx_cmp_sockaddr` 
  1402. 
  1403.         } else {
  1404.             len = slen2 - offsetof(struct sockaddr_un, sun_path);
                    ^
  1405.         }
  1406. 

ngx_int_t
ngx_cmp_sockaddr(struct sockaddr *sa1, socklen_t slen1,
    struct sockaddr *sa2, socklen_t slen2, ngx_uint_t cmp_port)
{
    struct sockaddr_in   *sin1, *sin2;
#if (NGX_HAVE_INET6)
    struct sockaddr_in6  *sin61, *sin62;
#endif
#if (NGX_HAVE_UNIX_DOMAIN)
    size_t                len;
    struct sockaddr_un   *saun1, *saun2;
#endif
    if (sa1->sa_family != sa2->sa_family) {
        return NGX_DECLINED;
    }
    switch (sa1->sa_family) {
#if (NGX_HAVE_INET6)
    case AF_INET6:
        sin61 = (struct sockaddr_in6 *) sa1;
        sin62 = (struct sockaddr_in6 *) sa2;
        if (cmp_port && sin61->sin6_port != sin62->sin6_port) {
            return NGX_DECLINED;
        }
        if (ngx_memcmp(&sin61->sin6_addr, &sin62->sin6_addr, 16) != 0) {
            return NGX_DECLINED;
        }
        break;
#endif
#if (NGX_HAVE_UNIX_DOMAIN)
    case AF_UNIX:
        saun1 = (struct sockaddr_un *) sa1;
        saun2 = (struct sockaddr_un *) sa2;
        if (slen1 < slen2) {
            len = slen1 - offsetof(struct sockaddr_un, sun_path);
        } else {
            len = slen2 - offsetof(struct sockaddr_un, sun_path);
        }
        if (len > sizeof(saun1->sun_path)) {
            len = sizeof(saun1->sun_path);
        }
        if (ngx_memcmp(&saun1->sun_path, &saun2->sun_path, len) != 0) {
            return NGX_DECLINED;
        }
        break;
#endif
    default:
        sin1 = (struct sockaddr_in *) sa1;
        sin2 = (struct sockaddr_in *) sa2;
        if (cmp_port && sin1->sin_port != sin2->sin_port) {
            return NGX_DECLINED;
        }
        if (sin1->sin_addr.s_addr != sin2->sin_addr.s_addr) {
            return NGX_DECLINED;
        }
        break;
    }
    return NGX_OK;
}
['static ngx_int_t\nngx_http_add_addresses(ngx_conf_t *cf, ngx_http_core_srv_conf_t *cscf,\n    ngx_http_conf_port_t *port, ngx_http_listen_opt_t *lsopt)\n{\n    ngx_uint_t             i, default_server, proxy_protocol;\n    ngx_http_conf_addr_t  *addr;\n#if (NGX_HTTP_SSL)\n    ngx_uint_t             ssl;\n#endif\n#if (NGX_HTTP_V2)\n    ngx_uint_t             http2;\n#endif\n    addr = port->addrs.elts;\n    for (i = 0; i < port->addrs.nelts; i++) {\n        if (ngx_cmp_sockaddr(&lsopt->sockaddr.sockaddr, lsopt->socklen,\n                             &addr[i].opt.sockaddr.sockaddr,\n                             addr[i].opt.socklen, 0)\n            != NGX_OK)\n        {\n            continue;\n        }\n        if (ngx_http_add_server(cf, cscf, &addr[i]) != NGX_OK) {\n            return NGX_ERROR;\n        }\n        default_server = addr[i].opt.default_server;\n        proxy_protocol = lsopt->proxy_protocol || addr[i].opt.proxy_protocol;\n#if (NGX_HTTP_SSL)\n        ssl = lsopt->ssl || addr[i].opt.ssl;\n#endif\n#if (NGX_HTTP_V2)\n        http2 = lsopt->http2 || addr[i].opt.http2;\n#endif\n        if (lsopt->set) {\n            if (addr[i].opt.set) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                        "duplicate listen options for %s", addr[i].opt.addr);\n                return NGX_ERROR;\n            }\n            addr[i].opt = *lsopt;\n        }\n        if (lsopt->default_server) {\n            if (default_server) {\n                ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,\n                        "a duplicate default server for %s", addr[i].opt.addr);\n                return NGX_ERROR;\n            }\n            default_server = 1;\n            addr[i].default_server = cscf;\n        }\n        addr[i].opt.default_server = default_server;\n        addr[i].opt.proxy_protocol = proxy_protocol;\n#if (NGX_HTTP_SSL)\n        addr[i].opt.ssl = ssl;\n#endif\n#if (NGX_HTTP_V2)\n        addr[i].opt.http2 = http2;\n#endif\n        return NGX_OK;\n    }\n    return ngx_http_add_address(cf, cscf, port, lsopt);\n}', 'ngx_int_t\nngx_cmp_sockaddr(struct sockaddr *sa1, socklen_t slen1,\n    struct sockaddr *sa2, socklen_t slen2, ngx_uint_t cmp_port)\n{\n    struct sockaddr_in   *sin1, *sin2;\n#if (NGX_HAVE_INET6)\n    struct sockaddr_in6  *sin61, *sin62;\n#endif\n#if (NGX_HAVE_UNIX_DOMAIN)\n    size_t                len;\n    struct sockaddr_un   *saun1, *saun2;\n#endif\n    if (sa1->sa_family != sa2->sa_family) {\n        return NGX_DECLINED;\n    }\n    switch (sa1->sa_family) {\n#if (NGX_HAVE_INET6)\n    case AF_INET6:\n        sin61 = (struct sockaddr_in6 *) sa1;\n        sin62 = (struct sockaddr_in6 *) sa2;\n        if (cmp_port && sin61->sin6_port != sin62->sin6_port) {\n            return NGX_DECLINED;\n        }\n        if (ngx_memcmp(&sin61->sin6_addr, &sin62->sin6_addr, 16) != 0) {\n            return NGX_DECLINED;\n        }\n        break;\n#endif\n#if (NGX_HAVE_UNIX_DOMAIN)\n    case AF_UNIX:\n        saun1 = (struct sockaddr_un *) sa1;\n        saun2 = (struct sockaddr_un *) sa2;\n        if (slen1 < slen2) {\n            len = slen1 - offsetof(struct sockaddr_un, sun_path);\n        } else {\n            len = slen2 - offsetof(struct sockaddr_un, sun_path);\n        }\n        if (len > sizeof(saun1->sun_path)) {\n            len = sizeof(saun1->sun_path);\n        }\n        if (ngx_memcmp(&saun1->sun_path, &saun2->sun_path, len) != 0) {\n            return NGX_DECLINED;\n        }\n        break;\n#endif\n    default:\n        sin1 = (struct sockaddr_in *) sa1;\n        sin2 = (struct sockaddr_in *) sa2;\n        if (cmp_port && sin1->sin_port != sin2->sin_port) {\n            return NGX_DECLINED;\n        }\n        if (sin1->sin_addr.s_addr != sin2->sin_addr.s_addr) {\n            return NGX_DECLINED;\n        }\n        break;\n    }\n    return NGX_OK;\n}']