]> git.kaiwu.me - nginx.git/commitdiff
Xslt: xmlCreatePushParserCtxt() error handling master
authorVadim Zhestikov <v.zhestikov@f5.com>
Thu, 16 Jul 2026 00:45:35 +0000 (17:45 -0700)
committerVadimZhestikov <108960056+VadimZhestikov@users.noreply.github.com>
Thu, 16 Jul 2026 19:27:25 +0000 (12:27 -0700)
On parser allocation failure, context was left uninitialized
resulting in null pointer dereference.

src/http/modules/ngx_http_xslt_filter_module.c

index f0586f867e8f1deffbf7e679a0adaf7fc15345a9..608e6f1d8afc195f9a173f72b33105b8f8fbfd81 100644 (file)
@@ -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)