src/http/ngx_http_request.c:1064: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned32 by call to `ngx_http_read_request_header`.

src/http/ngx_http_request.c:1071:14: Unknown value from: ngx_http_parse_header_line
1069.         }
1070. 
1071.         rc = ngx_http_parse_header_line(r, r->header_in,
                   ^
1072.                                         cscf->underscores_in_headers);
1073. 

src/http/ngx_http_request.c:1064:17: Call
1062.             }
1063. 
1064.             n = ngx_http_read_request_header(r);
                      ^
1065. 
1066.             if (n == NGX_AGAIN || n == NGX_ERROR) {

src/http/ngx_http_request.c:1175:1: Parameter `r->uri_changes`
  1173. 
  1174. 
  1175. static ssize_t
        ^
  1176. ngx_http_read_request_header(ngx_http_request_t *r)
  1177. {

src/http/ngx_http_request.c:1222:9: Call
  1220.         c->log->action = "reading client request headers";
  1221. 
  1222.         ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
                ^
  1223.         return NGX_ERROR;
  1224.     }

src/http/ngx_http_request.c:2010:1: Parameter `r->uri_changes`
    2008. 
    2009. 
    2010. void
          ^
    2011. ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
    2012. {

src/http/ngx_http_request.c:2048:13: Call
    2046.         || c->error)
    2047.     {
    2048.         if (ngx_http_post_action(r) == NGX_OK) {
                      ^
    2049.             return;
    2050.         }

src/http/ngx_http_request.c:3020:1: Parameter `r->uri_changes`
      3018. 
      3019. 
      3020. static ngx_int_t
            ^
      3021. ngx_http_post_action(ngx_http_request_t *r)
      3022. {

src/http/ngx_http_request.c:3047:9: Call
      3045. 
      3046.     if (clcf->post_action.data[0] == '/') {
      3047.         ngx_http_internal_redirect(r, &clcf->post_action, NULL);
                    ^
      3048. 
      3049.     } else {

src/http/ngx_http_core_module.c:2540:1: <LHS trace>
2538. 
2539. 
2540. ngx_int_t
      ^
2541. ngx_http_internal_redirect(ngx_http_request_t *r,
2542.     ngx_str_t *uri, ngx_str_t *args)

src/http/ngx_http_core_module.c:2540:1: Parameter `r->uri_changes`
        2538. 
        2539. 
        2540. ngx_int_t
              ^
        2541. ngx_http_internal_redirect(ngx_http_request_t *r,
        2542.     ngx_str_t *uri, ngx_str_t *args)

src/http/ngx_http_core_module.c:2546:5: Binary operation: ([0, +oo] - 1):unsigned32 by call to `ngx_http_read_request_header` 
        2544.     ngx_http_core_srv_conf_t  *cscf;
        2545. 
        2546.     r->uri_changes--;
                  ^
        2547. 
        2548.     if (r->uri_changes == 0) {

ngx_int_t
ngx_http_internal_redirect(ngx_http_request_t *r,
    ngx_str_t *uri, ngx_str_t *args)
{
    ngx_http_core_srv_conf_t  *cscf;
    r->uri_changes--;
    if (r->uri_changes == 0) {
        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
                      "rewrite or internal redirection cycle "
                      "while internally redirecting to \"%V\"", uri);
        r->main->count++;
        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
        return NGX_DONE;
    }
    r->uri = *uri;
    if (args) {
        r->args = *args;
    } else {
        ngx_str_null(&r->args);
    }
    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
                   "internal redirect: \"%V?%V\"", uri, &r->args);
    ngx_http_set_exten(r);
    ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
    r->loc_conf = cscf->ctx->loc_conf;
    ngx_http_update_location_config(r);
#if (NGX_HTTP_CACHE)
    r->cache = NULL;
#endif
    r->internal = 1;
    r->valid_unparsed_uri = 0;
    r->add_uri_to_alias = 0;
    r->main->count++;
    ngx_http_handler(r);
    return NGX_DONE;
}
['static void\nngx_http_process_request_headers(ngx_event_t *rev)\n{\n    u_char                     *p;\n    size_t                      len;\n    ssize_t                     n;\n    ngx_int_t                   rc, rv;\n    ngx_table_elt_t            *h;\n    ngx_connection_t           *c;\n    ngx_http_header_t          *hh;\n    ngx_http_request_t         *r;\n    ngx_http_core_srv_conf_t   *cscf;\n    ngx_http_core_main_conf_t  *cmcf;\n    c = rev->data;\n    r = c->data;\n    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, rev->log, 0,\n                   "http process request header line");\n    if (rev->timedout) {\n        ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, "client timed out");\n        c->timedout = 1;\n        ngx_http_close_request(r, NGX_HTTP_REQUEST_TIME_OUT);\n        return;\n    }\n    cmcf = ngx_http_get_module_main_conf(r, ngx_http_core_module);\n    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);\n    rc = NGX_AGAIN;\n    for ( ;; ) {\n        if (rc == NGX_AGAIN) {\n            if (r->header_in->pos == r->header_in->end) {\n                rv = ngx_http_alloc_large_header_buffer(r, 0);\n                if (rv == NGX_ERROR) {\n                    ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n                    return;\n                }\n                if (rv == NGX_DECLINED) {\n                    p = r->header_name_start;\n                    r->lingering_close = 1;\n                    if (p == NULL) {\n                        ngx_log_error(NGX_LOG_INFO, c->log, 0,\n                                      "client sent too large request");\n                        ngx_http_finalize_request(r,\n                                            NGX_HTTP_REQUEST_HEADER_TOO_LARGE);\n                        return;\n                    }\n                    len = r->header_in->end - p;\n                    if (len > NGX_MAX_ERROR_STR - 300) {\n                        len = NGX_MAX_ERROR_STR - 300;\n                        p[len++] = \'.\'; p[len++] = \'.\'; p[len++] = \'.\';\n                    }\n                    ngx_log_error(NGX_LOG_INFO, c->log, 0,\n                                  "client sent too long header line: \\"%*s\\"",\n                                  len, r->header_name_start);\n                    ngx_http_finalize_request(r,\n                                            NGX_HTTP_REQUEST_HEADER_TOO_LARGE);\n                    return;\n                }\n            }\n            n = ngx_http_read_request_header(r);\n            if (n == NGX_AGAIN || n == NGX_ERROR) {\n                return;\n            }\n        }\n        rc = ngx_http_parse_header_line(r, r->header_in,\n                                        cscf->underscores_in_headers);\n        if (rc == NGX_OK) {\n            r->request_length += r->header_in->pos - r->header_name_start;\n            if (r->invalid_header && cscf->ignore_invalid_headers) {\n                ngx_log_error(NGX_LOG_INFO, c->log, 0,\n                              "client sent invalid header line: \\"%*s\\"",\n                              r->header_end - r->header_name_start,\n                              r->header_name_start);\n                continue;\n            }\n            h = ngx_list_push(&r->headers_in.headers);\n            if (h == NULL) {\n                ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n                return;\n            }\n            h->hash = r->header_hash;\n            h->key.len = r->header_name_end - r->header_name_start;\n            h->key.data = r->header_name_start;\n            h->key.data[h->key.len] = \'\\0\';\n            h->value.len = r->header_end - r->header_start;\n            h->value.data = r->header_start;\n            h->value.data[h->value.len] = \'\\0\';\n            h->lowcase_key = ngx_pnalloc(r->pool, h->key.len);\n            if (h->lowcase_key == NULL) {\n                ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n                return;\n            }\n            if (h->key.len == r->lowcase_index) {\n                ngx_memcpy(h->lowcase_key, r->lowcase_header, h->key.len);\n            } else {\n                ngx_strlow(h->lowcase_key, h->key.data, h->key.len);\n            }\n            hh = ngx_hash_find(&cmcf->headers_in_hash, h->hash,\n                               h->lowcase_key, h->key.len);\n            if (hh && hh->handler(r, h, hh->offset) != NGX_OK) {\n                return;\n            }\n            ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                           "http header: \\"%V: %V\\"",\n                           &h->key, &h->value);\n            continue;\n        }\n        if (rc == NGX_HTTP_PARSE_HEADER_DONE) {\n            ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                           "http header done");\n            r->request_length += r->header_in->pos - r->header_name_start;\n            r->http_state = NGX_HTTP_PROCESS_REQUEST_STATE;\n            rc = ngx_http_process_request_header(r);\n            if (rc != NGX_OK) {\n                return;\n            }\n            ngx_http_process_request(r);\n            return;\n        }\n        if (rc == NGX_AGAIN) {\n            continue;\n        }\n        ngx_log_error(NGX_LOG_INFO, c->log, 0,\n                      "client sent invalid header line: \\"%*s\\\\r...\\"",\n                      r->header_end - r->header_name_start,\n                      r->header_name_start);\n        ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);\n        return;\n    }\n}', 'static ssize_t\nngx_http_read_request_header(ngx_http_request_t *r)\n{\n    ssize_t                    n;\n    ngx_event_t               *rev;\n    ngx_connection_t          *c;\n    ngx_http_core_srv_conf_t  *cscf;\n    c = r->connection;\n    rev = c->read;\n    n = r->header_in->last - r->header_in->pos;\n    if (n > 0) {\n        return n;\n    }\n    if (rev->ready) {\n        n = c->recv(c, r->header_in->last,\n                    r->header_in->end - r->header_in->last);\n    } else {\n        n = NGX_AGAIN;\n    }\n    if (n == NGX_AGAIN) {\n        if (!rev->timer_set) {\n            cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);\n            ngx_add_timer(rev, cscf->client_header_timeout);\n        }\n        if (ngx_handle_read_event(rev, 0) != NGX_OK) {\n            ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n            return NGX_ERROR;\n        }\n        return NGX_AGAIN;\n    }\n    if (n == 0) {\n        ngx_log_error(NGX_LOG_INFO, c->log, 0,\n                      "client prematurely closed connection");\n    }\n    if (n == 0 || n == NGX_ERROR) {\n        c->error = 1;\n        c->log->action = "reading client request headers";\n        ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);\n        return NGX_ERROR;\n    }\n    r->header_in->last += n;\n    return n;\n}', 'void\nngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)\n{\n    ngx_connection_t          *c;\n    ngx_http_request_t        *pr;\n    ngx_http_core_loc_conf_t  *clcf;\n    c = r->connection;\n    ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,\n                   "http finalize request: %d, \\"%V?%V\\" a:%d, c:%d",\n                   rc, &r->uri, &r->args, r == c->data, r->main->count);\n    if (rc == NGX_DONE) {\n        ngx_http_finalize_connection(r);\n        return;\n    }\n    if (rc == NGX_OK && r->filter_finalize) {\n        c->error = 1;\n    }\n    if (rc == NGX_DECLINED) {\n        r->content_handler = NULL;\n        r->write_event_handler = ngx_http_core_run_phases;\n        ngx_http_core_run_phases(r);\n        return;\n    }\n    if (r != r->main && r->post_subrequest) {\n        rc = r->post_subrequest->handler(r, r->post_subrequest->data, rc);\n    }\n    if (rc == NGX_ERROR\n        || rc == NGX_HTTP_REQUEST_TIME_OUT\n        || rc == NGX_HTTP_CLIENT_CLOSED_REQUEST\n        || c->error)\n    {\n        if (ngx_http_post_action(r) == NGX_OK) {\n            return;\n        }\n        if (r->main->blocked) {\n            r->write_event_handler = ngx_http_request_finalizer;\n        }\n        ngx_http_terminate_request(r, rc);\n        return;\n    }\n    if (rc >= NGX_HTTP_SPECIAL_RESPONSE\n        || rc == NGX_HTTP_CREATED\n        || rc == NGX_HTTP_NO_CONTENT)\n    {\n        if (rc == NGX_HTTP_CLOSE) {\n            ngx_http_terminate_request(r, rc);\n            return;\n        }\n        if (r == r->main) {\n            if (c->read->timer_set) {\n                ngx_del_timer(c->read);\n            }\n            if (c->write->timer_set) {\n                ngx_del_timer(c->write);\n            }\n        }\n        c->read->handler = ngx_http_request_handler;\n        c->write->handler = ngx_http_request_handler;\n        ngx_http_finalize_request(r, ngx_http_special_response_handler(r, rc));\n        return;\n    }\n    if (r != r->main) {\n        if (r->buffered || r->postponed) {\n            if (ngx_http_set_write_handler(r) != NGX_OK) {\n                ngx_http_terminate_request(r, 0);\n            }\n            return;\n        }\n        pr = r->parent;\n        if (r == c->data) {\n            r->main->count--;\n            r->main->subrequests++;\n            if (!r->logged) {\n                clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);\n                if (clcf->log_subrequest) {\n                    ngx_http_log_request(r);\n                }\n                r->logged = 1;\n            } else {\n                ngx_log_error(NGX_LOG_ALERT, c->log, 0,\n                              "subrequest: \\"%V?%V\\" logged again",\n                              &r->uri, &r->args);\n            }\n            r->done = 1;\n            if (pr->postponed && pr->postponed->request == r) {\n                pr->postponed = pr->postponed->next;\n            }\n            c->data = pr;\n        } else {\n            ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,\n                           "http finalize non-active request: \\"%V?%V\\"",\n                           &r->uri, &r->args);\n            r->write_event_handler = ngx_http_request_finalizer;\n            if (r->waited) {\n                r->done = 1;\n            }\n        }\n        if (ngx_http_post_request(pr, NULL) != NGX_OK) {\n            r->main->count++;\n            ngx_http_terminate_request(r, 0);\n            return;\n        }\n        ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,\n                       "http wake parent request: \\"%V?%V\\"",\n                       &pr->uri, &pr->args);\n        return;\n    }\n    if (r->buffered || c->buffered || r->postponed || r->blocked) {\n        if (ngx_http_set_write_handler(r) != NGX_OK) {\n            ngx_http_terminate_request(r, 0);\n        }\n        return;\n    }\n    if (r != c->data) {\n        ngx_log_error(NGX_LOG_ALERT, c->log, 0,\n                      "http finalize non-active request: \\"%V?%V\\"",\n                      &r->uri, &r->args);\n        return;\n    }\n    r->done = 1;\n    r->write_event_handler = ngx_http_request_empty_handler;\n    if (!r->post_action) {\n        r->request_complete = 1;\n    }\n    if (ngx_http_post_action(r) == NGX_OK) {\n        return;\n    }\n    if (c->read->timer_set) {\n        ngx_del_timer(c->read);\n    }\n    if (c->write->timer_set) {\n        c->write->delayed = 0;\n        ngx_del_timer(c->write);\n    }\n    if (c->read->eof) {\n        ngx_http_close_request(r, 0);\n        return;\n    }\n    ngx_http_finalize_connection(r);\n}', 'static ngx_int_t\nngx_http_post_action(ngx_http_request_t *r)\n{\n    ngx_http_core_loc_conf_t  *clcf;\n    clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);\n    if (clcf->post_action.data == NULL) {\n        return NGX_DECLINED;\n    }\n    if (r->post_action && r->uri_changes == 0) {\n        return NGX_DECLINED;\n    }\n    ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "post action: \\"%V\\"", &clcf->post_action);\n    r->main->count--;\n    r->http_version = NGX_HTTP_VERSION_9;\n    r->header_only = 1;\n    r->post_action = 1;\n    r->read_event_handler = ngx_http_block_reading;\n    if (clcf->post_action.data[0] == \'/\') {\n        ngx_http_internal_redirect(r, &clcf->post_action, NULL);\n    } else {\n        ngx_http_named_location(r, &clcf->post_action);\n    }\n    return NGX_OK;\n}', 'ngx_int_t\nngx_http_internal_redirect(ngx_http_request_t *r,\n    ngx_str_t *uri, ngx_str_t *args)\n{\n    ngx_http_core_srv_conf_t  *cscf;\n    r->uri_changes--;\n    if (r->uri_changes == 0) {\n        ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                      "rewrite or internal redirection cycle "\n                      "while internally redirecting to \\"%V\\"", uri);\n        r->main->count++;\n        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);\n        return NGX_DONE;\n    }\n    r->uri = *uri;\n    if (args) {\n        r->args = *args;\n    } else {\n        ngx_str_null(&r->args);\n    }\n    ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "internal redirect: \\"%V?%V\\"", uri, &r->args);\n    ngx_http_set_exten(r);\n    ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);\n    cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);\n    r->loc_conf = cscf->ctx->loc_conf;\n    ngx_http_update_location_config(r);\n#if (NGX_HTTP_CACHE)\n    r->cache = NULL;\n#endif\n    r->internal = 1;\n    r->valid_unparsed_uri = 0;\n    r->add_uri_to_alias = 0;\n    r->main->count++;\n    ngx_http_handler(r);\n    return NGX_DONE;\n}']