Skip to content

ext/xsl: handle xsltNewTransformContext allocation failure#51

Closed
iliaal wants to merge 1 commit intoPHP-8.4from
fix/xsl-transformcontext-null-8.4
Closed

ext/xsl: handle xsltNewTransformContext allocation failure#51
iliaal wants to merge 1 commit intoPHP-8.4from
fix/xsl-transformcontext-null-8.4

Conversation

@iliaal
Copy link
Copy Markdown
Owner

@iliaal iliaal commented Apr 27, 2026

xsltNewTransformContext returns NULL on libxslt-internal allocation failure; the next line dereferenced ctxt to set _private and segfaulted. Bail through the existing out: label, which handles secPrefs and intern->doc cleanup. xsltFreeTransformContext(NULL) is a documented no-op in libxslt.

xsltNewTransformContext can return NULL on libxslt-internal allocation
failure. The next line dereferences ctxt unconditionally to set
ctxt->_private, segfaulting on OOM. Bail through the existing out:
label, which already handles secPrefs/intern->doc cleanup.

xsltFreeTransformContext(NULL) is a documented no-op in libxslt.
@iliaal iliaal closed this Apr 27, 2026
@iliaal
Copy link
Copy Markdown
Owner Author

iliaal commented Apr 27, 2026

Superseded by php#21887.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant