src/http/ngx_http_script.c:1077: error: Integer Overflow L2
  ([0, +oo] - 1):unsigned64 by call to `ngx_http_set_exten`.

src/http/ngx_http_script.c:1077:9: Call
1075.         }
1076. 
1077.         ngx_http_set_exten(r);
              ^
1078.     }
1079. 

src/http/ngx_http_core_module.c:1672:1: <LHS trace>
1670. 
1671. 
1672. void
      ^
1673. ngx_http_set_exten(ngx_http_request_t *r)
1674. {

src/http/ngx_http_core_module.c:1672:1: Parameter `r->uri.len`
  1670. 
  1671. 
  1672. void
        ^
  1673. ngx_http_set_exten(ngx_http_request_t *r)
  1674. {

src/http/ngx_http_core_module.c:1680:10: Binary operation: ([0, +oo] - 1):unsigned64 by call to `ngx_http_set_exten` 
  1678.     r->exten.data = NULL;
  1679. 
  1680.     for (i = r->uri.len - 1; i > 1; i--) {
                 ^
  1681.         if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
  1682. 

void
ngx_http_set_exten(ngx_http_request_t *r)
{
    ngx_int_t  i;
    r->exten.len = 0;
    r->exten.data = NULL;
    for (i = r->uri.len - 1; i > 1; i--) {
        if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {
            r->exten.len = r->uri.len - i - 1;
            r->exten.data = &r->uri.data[i + 1];
            return;
        } else if (r->uri.data[i] == '/') {
            return;
        }
    }
    return;
}
['void\nngx_http_script_regex_end_code(ngx_http_script_engine_t *e)\n{\n    u_char                            *dst, *src;\n    ngx_http_request_t                *r;\n    ngx_http_script_regex_end_code_t  *code;\n    code = (ngx_http_script_regex_end_code_t *) e->ip;\n    r = e->request;\n    e->quote = 0;\n    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,\n                   "http script regex end");\n    if (code->redirect) {\n        dst = e->buf.data;\n        src = e->buf.data;\n        ngx_unescape_uri(&dst, &src, e->pos - e->buf.data,\n                         NGX_UNESCAPE_REDIRECT);\n        if (src < e->pos) {\n            dst = ngx_copy(dst, src, e->pos - src);\n        }\n        e->pos = dst;\n        if (code->add_args && r->args.len) {\n            *e->pos++ = (u_char) (code->args ? \'&\' : \'?\');\n            e->pos = ngx_copy(e->pos, r->args.data, r->args.len);\n        }\n        e->buf.len = e->pos - e->buf.data;\n        if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {\n            ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,\n                          "rewritten redirect: \\"%V\\"", &e->buf);\n        }\n        r->headers_out.location = ngx_list_push(&r->headers_out.headers);\n        if (r->headers_out.location == NULL) {\n            e->ip = ngx_http_script_exit;\n            e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;\n            return;\n        }\n        r->headers_out.location->hash = 1;\n        r->headers_out.location->key.len = sizeof("Location") - 1;\n        r->headers_out.location->key.data = (u_char *) "Location";\n        r->headers_out.location->value = e->buf;\n        e->ip += sizeof(ngx_http_script_regex_end_code_t);\n        return;\n    }\n    if (e->args) {\n        e->buf.len = e->args - e->buf.data;\n        if (code->add_args && r->args.len) {\n            *e->pos++ = \'&\';\n            e->pos = ngx_copy(e->pos, r->args.data, r->args.len);\n        }\n        r->args.len = e->pos - e->args;\n        r->args.data = e->args;\n        e->args = NULL;\n    } else {\n        e->buf.len = e->pos - e->buf.data;\n        if (!code->add_args) {\n            r->args.len = 0;\n        }\n    }\n    if (e->log || (r->connection->log->log_level & NGX_LOG_DEBUG_HTTP)) {\n        ngx_log_error(NGX_LOG_NOTICE, r->connection->log, 0,\n                      "rewritten data: \\"%V\\", args: \\"%V\\"",\n                      &e->buf, &r->args);\n    }\n    if (code->uri) {\n        r->uri = e->buf;\n        if (r->uri.len == 0) {\n            ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,\n                          "the rewritten URI has a zero length");\n            e->ip = ngx_http_script_exit;\n            e->status = NGX_HTTP_INTERNAL_SERVER_ERROR;\n            return;\n        }\n        ngx_http_set_exten(r);\n    }\n    e->ip += sizeof(ngx_http_script_regex_end_code_t);\n}', "void\nngx_http_set_exten(ngx_http_request_t *r)\n{\n    ngx_int_t  i;\n    r->exten.len = 0;\n    r->exten.data = NULL;\n    for (i = r->uri.len - 1; i > 1; i--) {\n        if (r->uri.data[i] == '.' && r->uri.data[i - 1] != '/') {\n            r->exten.len = r->uri.len - i - 1;\n            r->exten.data = &r->uri.data[i + 1];\n            return;\n        } else if (r->uri.data[i] == '/') {\n            return;\n        }\n    }\n    return;\n}"]