[php-src] PHP-8.5: ext/xsl: Fix crash in transformToDoc() with an uninstantiable class
| From: | Ilia Alshanetsky | Date: | Fri, 20 Nov 2026 00:17:43 +0000 |
| Subject: | [php-src] PHP-8.5: ext/xsl: Fix crash in transformToDoc() with an uninstantiable class | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-143951@lists.php.net to get a copy of this message | ||
Author: Ilia Alshanetsky (iliaal)
Date: 2026-11-19T19:10:01-05:00
Commit: https://github.com/php/php-src/commit/d8e34952e274711b22fa43a93884ee3c8b991f1c
Raw diff: https://github.com/php/php-src/commit/d8e34952e274711b22fa43a93884ee3c8b991f1c.diff
ext/xsl: Fix crash in transformToDoc() with an uninstantiable class
XSLTProcessor::transformToDoc() ignored the result of object_init_ex() for
the return class and then used the zval as a libxml node object.
object_init_ex() fails when the class is abstract, which includes the
internal Dom\Document, or has a constant expression that cannot be
evaluated, such as a property default naming an undefined constant. The
zval is then NULL and the call crashed. Free the result document and return
with the pending exception instead. Without a return class the document is
wrapped by php_dom_create_object() with no class map, which only
instantiates internal classes.
Closes GH-25603
Changed paths:
A ext/xsl/tests/transformToDoc_uninstantiable_class.phpt
M NEWS
M ext/xsl/xsltprocessor.c
Diff: