]> git.kaiwu.me - nginx.git/commitdiff
Xslt: xmlCreatePushParserCtxt() error handling
authorVadim Zhestikov <v.zhestikov@f5.com>
Thu, 16 Jul 2026 00:45:35 +0000 (17:45 -0700)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 2 Oct 2026 14:33:28 +0000 (18:33 +0400)
On parser allocation failure, context was left uninitialized
resulting in null pointer dereference.

src/http/modules/ngx_http_xslt_filter_module.c

index 38bc7c52b4841bf50c693c8c8f7a5094649d606d..f9996f763c4a7f86144f3061de04f602a039c8bc 100644 (file)
@@ -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)