From: Vadim Zhestikov Date: Thu, 16 Jul 2026 00:45:35 +0000 (-0700) Subject: Xslt: xmlCreatePushParserCtxt() error handling X-Git-Url: http://git.kaiwu.me/http/doc/static/%22data:,/$%7BGITURL%7D/$%7BGITURL%7D$%7Bcid%7D?a=commitdiff_plain;ds=sidebyside;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 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)