diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nxt_fs.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 <alx@kernel.org> */ #include <nxt_main.h> @@ -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; } |