]> git.kaiwu.me - njs.git/commitdiff
Checking cwd path length in njs_module_relative_path().
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 14 Dec 2021 20:06:23 +0000 (20:06 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Tue, 14 Dec 2021 20:06:23 +0000 (20:06 +0000)
src/njs_module.c

index 829a175af54e3aea7dbcc22b8b48f9e096635255..e5243312d1e30d894a8c15b3dbe87023e18ce38f 100644 (file)
@@ -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) {