From 57428e8ece3e0774c37a47e98f3d9859b8e59d15 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Tue, 14 Dec 2021 20:06:23 +0000 Subject: [PATCH] Checking cwd path length in njs_module_relative_path(). --- src/njs_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/njs_module.c b/src/njs_module.c index 829a175a..e5243312 100644 --- a/src/njs_module.c +++ b/src/njs_module.c @@ -361,6 +361,10 @@ njs_module_relative_path(njs_vm_t *vm, const njs_str_t *dir, file.length = dir->length; + if (file.length == 0) { + return NJS_DECLINED; + } + trail = (dir->start[dir->length - 1] != '/'); if (trail) { -- 2.47.3