From fc9749b4170d493868dfaf44411d8fd9325d2f47 Mon Sep 17 00:00:00 2001 From: Vadim Zhestikov Date: Wed, 15 Jul 2026 17:45:35 -0700 Subject: [PATCH] Xslt: xmlCreatePushParserCtxt() error handling On parser allocation failure, context was left uninitialized resulting in null pointer dereference. --- src/http/modules/ngx_http_xslt_filter_module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/http/modules/ngx_http_xslt_filter_module.c b/src/http/modules/ngx_http_xslt_filter_module.c index f0586f867..608e6f1d8 100644 --- a/src/http/modules/ngx_http_xslt_filter_module.c +++ b/src/http/modules/ngx_http_xslt_filter_module.c @@ -279,6 +279,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) -- 2.47.3