String conversion recovered the context through ctx->engine even though
both the JSContext and destination pool were already supplied. During
module evaluation the engine is not published yet, so synchronous
Request and Headers construction could dereference NULL.
Use the supplied context without changing allocation or copy behavior.
The dependency was introduced in
201b1276.
u_char *start;
JSValue buffer;
const char *str;
- ngx_js_ctx_t *ctx;
- ngx_engine_t *e;
-
- ctx = ngx_qjs_external_ctx(cx, JS_GetContextOpaque(cx));
- e = ctx->engine;
if (JS_IsNullOrUndefined(val)) {
dst->data = NULL;
return NGX_OK;
}
- cx = e->u.qjs.ctx;
-
if (JS_IsString(val)) {
goto string;
}