src/http/ngx_http_file_cache.c:1813: error: Buffer Overrun S2
  Offset: [`cache->path->len`, +oo] Size: [0, +oo] by call to `ngx_http_file_cache_delete`.

src/http/ngx_http_file_cache.c:1755:1: Parameter `cache->path->len`
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: Parameter `*name`
  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:1893:9: Call
  1891. 
  1892.         len = path->name.len + 1 + path->len + 2 * NGX_HTTP_CACHE_KEY_LEN;
  1893.         ngx_create_hashed_filename(path, name, len);
                ^
  1894. 
  1895.         ngx_log_debug1(NGX_LOG_DEBUG_HTTP, ngx_cycle->log, 0,

src/core/ngx_file.c:218:1: <Offset trace>
216. 
217. 
218. void
     ^
219. ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len)
220. {

src/core/ngx_file.c:218:1: Parameter `path->len`
    216. 
    217. 
    218. void
         ^
    219. ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len)
    220. {

src/core/ngx_file.c:218:1: <Length trace>
216. 
217. 
218. void
     ^
219. ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len)
220. {

src/core/ngx_file.c:218:1: Parameter `*file`
    216. 
    217. 
    218. void
         ^
    219. ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len)
    220. {

src/core/ngx_file.c:226:5: Array access: Offset: [cache->path->len, +oo] Size: [0, +oo] by call to `ngx_http_file_cache_delete` 
    224.     i = path->name.len + 1;
    225. 
    226.     file[path->name.len + path->len]  = '/';
             ^
    227. 
    228.     for (n = 0; n < NGX_MAX_PATH_LEVEL; n++) {

void
ngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len)
{
    size_t      i, level;
    ngx_uint_t  n;
    i = path->name.len + 1;
    file[path->name.len + path->len]  = '/';
    for (n = 0; n < NGX_MAX_PATH_LEVEL; n++) {
        level = path->level[n];
        if (level == 0) {
            break;
        }
        len -= level;
        file[i - 1] = '/';
        ngx_memcpy(&file[i], &file[len], level);
        i += level + 1;
    }
}
['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}', "void\nngx_create_hashed_filename(ngx_path_t *path, u_char *file, size_t len)\n{\n    size_t      i, level;\n    ngx_uint_t  n;\n    i = path->name.len + 1;\n    file[path->name.len + path->len]  = '/';\n    for (n = 0; n < NGX_MAX_PATH_LEVEL; n++) {\n        level = path->level[n];\n        if (level == 0) {\n            break;\n        }\n        len -= level;\n        file[i - 1] = '/';\n        ngx_memcpy(&file[i], &file[len], level);\n        i += level + 1;\n    }\n}"]