diff --git a/src/nxt_fs.c b/src/nxt_fs.c index 6a93c670..788c3ee2 100644 --- a/src/nxt_fs.c +++ b/src/nxt_fs.c @@ -1,5 +1,6 @@ /* * Copyright (C) NGINX, Inc. + * Copyright 2024, Alejandro Colomar */ #include @@ -58,7 +59,7 @@ nxt_fs_mkdir_dirname(const u_char *path, mode_t mode) ret = NXT_OK; ptr = strrchr(dir, '/'); - if (nxt_slow_path(ptr == NULL)) { + if (ptr == dir || nxt_slow_path(ptr == NULL)) { goto out_free; }