aboutsummaryrefslogtreecommitdiff
path: root/nginx/ngx_http_js_module.c
diff options
context:
space:
mode:
authorDmitry Volyntsev <xeioex@nginx.com>2025-01-22 17:44:11 -0800
committerDmitry Volyntsev <xeioexception@gmail.com>2025-01-24 15:12:19 -0800
commit9f15b6986a1b5cd20b9c589142f5a0e586f8d798 (patch)
treedb178fb3c58409045657079611bcd4110b52a50e /nginx/ngx_http_js_module.c
parent70f75ed0cb19ab2348207b48b5b1e7ea7b9cac33 (diff)
downloadnjs-9f15b6986a1b5cd20b9c589142f5a0e586f8d798.tar.gz
njs-9f15b6986a1b5cd20b9c589142f5a0e586f8d798.zip
QuickJS: correctly handling value len for empty query params.
Diffstat (limited to 'nginx/ngx_http_js_module.c')
-rw-r--r--nginx/ngx_http_js_module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c
index e900b716..9b6d8ea1 100644
--- a/nginx/ngx_http_js_module.c
+++ b/nginx/ngx_http_js_module.c
@@ -4848,7 +4848,7 @@ ngx_http_qjs_ext_args(JSContext *cx, JSValueConst this_val)
return JS_EXCEPTION;
}
- val = qjs_string_create(cx, v + 1, p - v - 1);
+ val = qjs_string_create(cx, v + 1, (p == v) ? 0 : p - v - 1);
if (JS_IsException(val)) {
chain.free(cx, decoded.start);
JS_FreeAtom(cx, key);