From 37efcad453f602168c0ccbf526fc84a319b0985f Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Thu, 21 May 2026 17:23:09 -0700 Subject: [PATCH] Modules: fixed QuickJS log argument conversion --- nginx/ngx_http_js_module.c | 3 +++ nginx/ngx_stream_js_module.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nginx/ngx_http_js_module.c b/nginx/ngx_http_js_module.c index 530bea32..2412bbc0 100644 --- a/nginx/ngx_http_js_module.c +++ b/nginx/ngx_http_js_module.c @@ -6475,6 +6475,9 @@ ngx_http_qjs_ext_log(JSContext *cx, JSValueConst this_val, int argc, for (n = 0; n < argc; n++) { msg = JS_ToCString(cx, argv[n]); + if (msg == NULL) { + return JS_EXCEPTION; + } ngx_js_logger(r->connection, level, (u_char *) msg, ngx_strlen(msg)); diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index 5e550c57..096b96cb 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -2181,6 +2181,9 @@ ngx_stream_qjs_ext_log(JSContext *cx, JSValueConst this_val, int argc, for (n = 0; n < argc; n++) { msg = JS_ToCString(cx, argv[n]); + if (msg == NULL) { + return JS_EXCEPTION; + } ngx_js_logger(s->connection, level, (u_char *) msg, ngx_strlen(msg)); -- 2.47.3