src/http/ngx_http_file_cache.c:1813: error: Integer Overflow L2
  ([0, `cache->sh->count`] - 1):unsigned64 by call to `ngx_http_file_cache_delete`.

src/http/ngx_http_file_cache.c:1755:1: Parameter `cache->sh->count`
1753. 
1754. 
1755. static time_t
      ^
1756. ngx_http_file_cache_expire(ngx_http_file_cache_t *cache)
1757. {

src/http/ngx_http_file_cache.c:1813:13: Call
1811. 
1812.         if (fcn->count == 0) {
1813.             ngx_http_file_cache_delete(cache, q, name);
                  ^
1814.             goto next;
1815.         }

src/http/ngx_http_file_cache.c:1866:1: <LHS trace>
1864. 
1865. 
1866. static void
      ^
1867. ngx_http_file_cache_delete(ngx_http_file_cache_t *cache, ngx_queue_t *q,
1868.     u_char *name)

src/http/ngx_http_file_cache.c:1866:1: Parameter `cache->sh->count`
  1864. 
  1865. 
  1866. static void
        ^
  1867. ngx_http_file_cache_delete(ngx_http_file_cache_t *cache, ngx_queue_t *q,
  1868.     u_char *name)

src/http/ngx_http_file_cache.c:1912:9: Binary operation: ([0, cache->sh->count] - 1):unsigned64 by call to `ngx_http_file_cache_delete` 
  1910.         ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
  1911.         ngx_slab_free_locked(cache->shpool, fcn);
  1912.         cache->sh->count--;
                ^
  1913.     }
  1914. }

static void
ngx_http_file_cache_delete(ngx_http_file_cache_t *cache, ngx_queue_t *q,
    u_char *name)
{
    u_char                      *p;
    size_t                       len;
    ngx_path_t                  *path;
    ngx_http_file_cache_node_t  *fcn;
    fcn = ngx_queue_data(q, ngx_http_file_cache_node_t, queue);
    if (fcn->exists) {
        cache->sh->size -= fcn->fs_size;
        path = cache->path;
        p = name + path->name.len + 1 + path->len;
        p = ngx_hex_dump(p, (u_char *) &fcn->node.key,
                         sizeof(ngx_rbtree_key_t));
        len = NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t);
        p = ngx_hex_dump(p, fcn->key, len);
        *p = '\0';
        fcn->count++;
        fcn->deleting = 1;
        ngx_shmtx_unlock(&cache->shpool->mutex);
        len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;
        ngx_create_hashed_filename(path, name, len);
        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,
                       "http file cache expire: \"%s\"", name);
        if (ngx_delete_file(name) == NGX_FILE_ERROR) {
            ngx_log_error(NGX_LOG_CRIT, ngx_cycle->log, ngx_errno,
                          ngx_delete_file_n " \"%s\" failed", name);
        }
        ngx_shmtx_lock(&cache->shpool->mutex);
        fcn->count--;
        fcn->deleting = 0;
    }
    if (fcn->count == 0) {
        ngx_queue_remove(q);
        ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);
        ngx_slab_free_locked(cache->shpool, fcn);
        cache->sh->count--;
    }
}
['static time_t\nngx_http_file_cache_expire(ngx_http_file_cache_t *cache)\n{\n    u_char                      *name, *p;\n    size_t                       len;\n    time_t                       now, wait;\n    ngx_path_t                  *path;\n    ngx_msec_t                   elapsed;\n    ngx_queue_t                 *q;\n    ngx_http_file_cache_node_t  *fcn;\n    u_char                       key[2 * NGX_HTTP_CACHE_KEY_LEN];\n    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,\n                   "http file cache expire");\n    path = cache->path;\n    len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;\n    name = ngx_alloc(len + 1, ngx_cycle->log);\n    if (name == NULL) {\n        return 10;\n    }\n    ngx_memcpy(name, path->name.data, path->name.len);\n    now = ngx_time();\n    ngx_shmtx_lock(&cache->shpool->mutex);\n    for ( ;; ) {\n        if (ngx_quit || ngx_terminate) {\n            wait = 1;\n            break;\n        }\n        if (ngx_queue_empty(&cache->sh->queue)) {\n            wait = 10;\n            break;\n        }\n        q = ngx_queue_last(&cache->sh->queue);\n        fcn = ngx_queue_data(q, ngx_http_file_cache_node_t, queue);\n        wait = fcn->expire - now;\n        if (wait > 0) {\n            wait = wait > 10 ? 10 : wait;\n            break;\n        }\n        ngx_log_debug6(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,\n                       "http file cache expire: #%d %d %02xd%02xd%02xd%02xd",\n                       fcn->count, fcn->exists,\n                       fcn->key[0], fcn->key[1], fcn->key[2], fcn->key[3]);\n        if (fcn->count == 0) {\n            ngx_http_file_cache_delete(cache, q, name);\n            goto next;\n        }\n        if (fcn->deleting) {\n            wait = 1;\n            break;\n        }\n        p = ngx_hex_dump(key, (u_char *) &fcn->node.key,\n                         sizeof(ngx_rbtree_key_t));\n        len = NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t);\n        (void) ngx_hex_dump(p, fcn->key, len);\n        ngx_queue_remove(q);\n        fcn->expire = ngx_time() + cache->inactive;\n        ngx_queue_insert_head(&cache->sh->queue, &fcn->queue);\n        ngx_log_error(NGX_LOG_ALERT, ngx_cycle->log, 0,\n                      "ignore long locked inactive cache entry %*s, count:%d",\n                      (size_t) 2 * NGX_HTTP_CACHE_KEY_LEN, key, fcn->count);\nnext:\n        if (++cache->files >= cache->manager_files) {\n            wait = 0;\n            break;\n        }\n        ngx_time_update();\n        elapsed = ngx_abs((ngx_msec_int_t) (ngx_current_msec - cache->last));\n        if (elapsed >= cache->manager_threshold) {\n            wait = 0;\n            break;\n        }\n    }\n    ngx_shmtx_unlock(&cache->shpool->mutex);\n    ngx_free(name);\n    return wait;\n}', 'static void\nngx_http_file_cache_delete(ngx_http_file_cache_t *cache, ngx_queue_t *q,\n    u_char *name)\n{\n    u_char                      *p;\n    size_t                       len;\n    ngx_path_t                  *path;\n    ngx_http_file_cache_node_t  *fcn;\n    fcn = ngx_queue_data(q, ngx_http_file_cache_node_t, queue);\n    if (fcn->exists) {\n        cache->sh->size -= fcn->fs_size;\n        path = cache->path;\n        p = name + path->name.len + 1 + path->len;\n        p = ngx_hex_dump(p, (u_char *) &fcn->node.key,\n                         sizeof(ngx_rbtree_key_t));\n        len = NGX_HTTP_CACHE_KEY_LEN - sizeof(ngx_rbtree_key_t);\n        p = ngx_hex_dump(p, fcn->key, len);\n        *p = \'\\0\';\n        fcn->count++;\n        fcn->deleting = 1;\n        ngx_shmtx_unlock(&cache->shpool->mutex);\n        len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;\n        ngx_create_hashed_filename(path, name, len);\n        ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,\n                       "http file cache expire: \\"%s\\"", name);\n        if (ngx_delete_file(name) == NGX_FILE_ERROR) {\n            ngx_log_error(NGX_LOG_CRIT, ngx_cycle->log, ngx_errno,\n                          ngx_delete_file_n " \\"%s\\" failed", name);\n        }\n        ngx_shmtx_lock(&cache->shpool->mutex);\n        fcn->count--;\n        fcn->deleting = 0;\n    }\n    if (fcn->count == 0) {\n        ngx_queue_remove(q);\n        ngx_rbtree_delete(&cache->sh->rbtree, &fcn->node);\n        ngx_slab_free_locked(cache->shpool, fcn);\n        cache->sh->count--;\n    }\n}']