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

src/http/ngx_http_request.c:474:13: Call
472.         hc->proxy_protocol = 0;
473. 
474.         p = ngx_proxy_protocol_read(c, b->pos, b->last);
                 ^
475. 
476.         if (p == NULL) {

src/core/ngx_proxy_protocol.c:12:1: Parameter `*buf`
  10. 
  11. 
  12. u_char *
      ^
  13. ngx_proxy_protocol_read(ngx_connection_t *c, u_char *buf, u_char *last)
  14. {

src/core/ngx_proxy_protocol.c:99:9: Call
   97.     len = p - port - 1;
   98. 
   99.     n = ngx_atoi(port, len);
               ^
  100. 
  101.     if (n < 0 || n > 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_proxy_protocol_read` 
    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 void\nngx_http_wait_request_handler(ngx_event_t *rev)\n{\n    u_char                    *p;\n    size_t                     size;\n    ssize_t                    n;\n    ngx_buf_t                 *b;\n    ngx_connection_t          *c;\n    ngx_http_connection_t     *hc;\n    ngx_http_core_srv_conf_t  *cscf;\n    c = rev->data;\n    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http wait request handler");\n    if (rev->timedout) {\n        ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");\n        ngx_http_close_connection(c);\n        return;\n    }\n    if (c->close) {\n        ngx_http_close_connection(c);\n        return;\n    }\n    hc = c->data;\n    cscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_core_module);\n    size = cscf->client_header_buffer_size;\n    b = c->buffer;\n    if (b == NULL) {\n        b = ngx_create_temp_buf(c->pool, size);\n        if (b == NULL) {\n            ngx_http_close_connection(c);\n            return;\n        }\n        c->buffer = b;\n    } else if (b->start == NULL) {\n        b->start = ngx_palloc(c->pool, size);\n        if (b->start == NULL) {\n            ngx_http_close_connection(c);\n            return;\n        }\n        b->pos = b->start;\n        b->last = b->start;\n        b->end = b->last + size;\n    }\n    n = c->recv(c, b->last, size);\n    if (n == NGX_AGAIN) {\n        if (!rev->timer_set) {\n            ngx_add_timer(rev, c->listening->post_accept_timeout);\n            ngx_reusable_connection(c, 1);\n        }\n        if (ngx_handle_read_event(rev, 0) != NGX_OK) {\n            ngx_http_close_connection(c);\n            return;\n        }\n        if (ngx_pfree(c->pool, b->start) == NGX_OK) {\n            b->start = NULL;\n        }\n        return;\n    }\n    if (n == NGX_ERROR) {\n        ngx_http_close_connection(c);\n        return;\n    }\n    if (n == 0) {\n        ngx_log_error(NGX_LOG_INFO, c->log, 0,\n                      "client closed connection");\n        ngx_http_close_connection(c);\n        return;\n    }\n    b->last += n;\n    if (hc->proxy_protocol) {\n        hc->proxy_protocol = 0;\n        p = ngx_proxy_protocol_read(c, b->pos, b->last);\n        if (p == NULL) {\n            ngx_http_close_connection(c);\n            return;\n        }\n        b->pos = p;\n        if (b->pos == b->last) {\n            c->log->action = "waiting for request";\n            b->pos = b->start;\n            b->last = b->start;\n            ngx_post_event(rev, &ngx_posted_events);\n            return;\n        }\n    }\n    c->log->action = "reading client request line";\n    ngx_reusable_connection(c, 0);\n    c->data = ngx_http_create_request(c);\n    if (c->data == NULL) {\n        ngx_http_close_connection(c);\n        return;\n    }\n    rev->handler = ngx_http_process_request_line;\n    ngx_http_process_request_line(rev);\n}', 'u_char *\nngx_proxy_protocol_read(ngx_connection_t *c, u_char *buf, u_char *last)\n{\n    size_t     len;\n    u_char     ch, *p, *addr, *port;\n    ngx_int_t  n;\n    p = buf;\n    len = last - buf;\n    if (len < 8 || ngx_strncmp(p, "PROXY ", 6) != 0) {\n        goto invalid;\n    }\n    p += 6;\n    len -= 6;\n    if (len >= 7 && ngx_strncmp(p, "UNKNOWN", 7) == 0) {\n        ngx_log_debug0(NGX_LOG_DEBUG_CORE, c->log, 0,\n                       "PROXY protocol unknown protocol");\n        p += 7;\n        goto skip;\n    }\n    if (len < 5 || ngx_strncmp(p, "TCP", 3) != 0\n        || (p[3] != \'4\' && p[3] != \'6\') || p[4] != \' \')\n    {\n        goto invalid;\n    }\n    p += 5;\n    addr = p;\n    for ( ;; ) {\n        if (p == last) {\n            goto invalid;\n        }\n        ch = *p++;\n        if (ch == \' \') {\n            break;\n        }\n        if (ch != \':\' && ch != \'.\'\n            && (ch < \'a\' || ch > \'f\')\n            && (ch < \'A\' || ch > \'F\')\n            && (ch < \'0\' || ch > \'9\'))\n        {\n            goto invalid;\n        }\n    }\n    len = p - addr - 1;\n    c->proxy_protocol_addr.data = ngx_pnalloc(c->pool, len);\n    if (c->proxy_protocol_addr.data == NULL) {\n        return NULL;\n    }\n    ngx_memcpy(c->proxy_protocol_addr.data, addr, len);\n    c->proxy_protocol_addr.len = len;\n    for ( ;; ) {\n        if (p == last) {\n            goto invalid;\n        }\n        if (*p++ == \' \') {\n            break;\n        }\n    }\n    port = p;\n    for ( ;; ) {\n        if (p == last) {\n            goto invalid;\n        }\n        if (*p++ == \' \') {\n            break;\n        }\n    }\n    len = p - port - 1;\n    n = ngx_atoi(port, len);\n    if (n < 0 || n > 65535) {\n        goto invalid;\n    }\n    c->proxy_protocol_port = (in_port_t) n;\n    ngx_log_debug2(NGX_LOG_DEBUG_CORE, c->log, 0,\n                   "PROXY protocol address: %V %i", &c->proxy_protocol_addr, n);\nskip:\n    for (   ; p < last - 1; p++) {\n        if (p[0] == CR && p[1] == LF) {\n            return p + 2;\n        }\n    }\ninvalid:\n    ngx_log_error(NGX_LOG_ERR, c->log, 0,\n                  "broken header: \\"%*s\\"", (size_t) (last - buf), buf);\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}"]