From: Vadim Zhestikov Date: Thu, 16 Jul 2026 00:45:35 +0000 (-0700) Subject: Xslt: xmlCreatePushParserCtxt() error handling X-Git-Tag: release-1.30.6~21 X-Git-Url: https://git.kaiwu.me/?a=commitdiff_plain;h=be0f12efa03eb3a2dff323d578a9f47889cfa3f7;p=nginx.git Xslt: xmlCreatePushParserCtxt() error handling On parser allocation failure, context was left uninitialized resulting in null pointer dereference. --- diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c index 38bc7c52b..f9996f763 100644 --- a/src/http/modules/ngx_http_xslt_filter_module.c +++ b/src/http/modules/ngx_http_xslt_filter_module.c @@ -263,6 +263,10 @@ ngx_http_xslt_body_filter(ngx_http_request_t *r, ngx_chain_t *in) if (ngx_http_xslt_add_chunk(r, ctx, cl->buf) != NGX_OK) { + if (ctx->ctxt == NULL) { + return ngx_http_xslt_send(r, ctx, NULL); + } + if (ctx->ctxt->myDoc) { #if (NGX_HTTP_XSLT_REUSE_DTD)