From: Dmitry Volyntsev Date: Tue, 14 Dec 2021 20:06:23 +0000 (+0000) Subject: Checking cwd path length in njs_module_relative_path(). X-Git-Tag: 0.7.1~24 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=57428e8ece3e0774c37a47e98f3d9859b8e59d15;p=njs.git Checking cwd path length in njs_module_relative_path(). --- 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) {