From: Dmitry Volyntsev Date: Thu, 23 Jan 2025 01:44:11 +0000 (-0800) Subject: QuickJS: correctly handling value len for empty query params. X-Git-Tag: 0.8.10~45 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=9f15b6986a1b5cd20b9c589142f5a0e586f8d798;p=njs.git QuickJS: correctly handling value len for empty query params. --- 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);