[njs] Checking cwd path length in njs_module_relative_path().

Dmitry Volyntsev xeioex at nginx.com
Wed Dec 15 13:14:37 UTC 2021


details:   https://hg.nginx.org/njs/rev/ee500f43e2a2
branches:  
changeset: 1766:ee500f43e2a2
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Dec 14 20:06:23 2021 +0000
description:
Checking cwd path length in njs_module_relative_path().

diffstat:

 src/njs_module.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 02da0ed4a778 -r ee500f43e2a2 src/njs_module.c
--- a/src/njs_module.c	Tue Dec 14 14:08:12 2021 +0000
+++ b/src/njs_module.c	Tue Dec 14 20:06:23 2021 +0000
@@ -361,6 +361,10 @@ njs_module_relative_path(njs_vm_t *vm, c
 
     file.length = dir->length;
 
+    if (file.length == 0) {
+        return NJS_DECLINED;
+    }
+
     trail = (dir->start[dir->length - 1] != '/');
 
     if (trail) {


More information about the nginx-devel mailing list