diff options
author | Dmitry Volyntsev <xeioex@nginx.com> | 2025-02-12 19:11:08 -0800 |
---|---|---|
committer | Dmitry Volyntsev <xeioexception@gmail.com> | 2025-02-18 16:30:00 -0800 |
commit | b6d108c812c07b11d4c3f65a48a5898139ac1ae4 (patch) | |
tree | 754d96e34dd0f319ff1489b4c3af96543114487b /nginx/ngx_stream_js_module.c | |
parent | 0b6eca0a123000297d4e18d46770bad7416d5056 (diff) | |
download | njs-b6d108c812c07b11d4c3f65a48a5898139ac1ae4.tar.gz njs-b6d108c812c07b11d4c3f65a48a5898139ac1ae4.zip |
QuickJS: fixed non-NULL terminated strings formatting in exceptions.
When "%*s" is specified, the first integer is interpreted as width.
Width specifies *minimum* number of characters to output. The next
string is expected to be NULL-terminated.
When "%.*s" is specified, the first integer is interpreted as precision.
Precision specifies *maximum* number of characters to output.
Diffstat (limited to 'nginx/ngx_stream_js_module.c')
-rw-r--r-- | nginx/ngx_stream_js_module.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nginx/ngx_stream_js_module.c b/nginx/ngx_stream_js_module.c index a7a923ad..59a3e9d2 100644 --- a/nginx/ngx_stream_js_module.c +++ b/nginx/ngx_stream_js_module.c @@ -2126,7 +2126,7 @@ ngx_stream_qjs_event(ngx_stream_session_t *s, JSContext *cx, ngx_str_t *event) } if (i == n) { - (void) JS_ThrowInternalError(cx, "unknown event \"%*s\"", + (void) JS_ThrowInternalError(cx, "unknown event \"%.*s\"", (int) event->len, event->data); return NULL; } |