[php-src] PR #25751: Reject DTD declaration nodes in adoptNode
| From: | imattas | Date: | Wed, 25 Nov 2026 18:20:06 +0000 |
| Subject: | [php-src] PR #25751: Reject DTD declaration nodes in adoptNode | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-41009@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25751
Author: imattas
Closes #25750\n\nReject XML_ELEMENT_DECL, XML_ATTRIBUTE_DECL, and XML_ENTITY_DECL nodes before
cross-document adoption mutates libxml ownership. These DTD declarations remain owned by their
source DTD; moving them can crash during document teardown.\n\nAdds a modern DOM regression test for
element and entity declarations.\n\nTests (ASan build with libxml2 2.9.14):\n-
ASAN_OPTIONS=detect_leaks=0 USE_ZEND_ALLOC=0 sapi/cli/php run-tests.php -q
ext/dom/tests/modern/spec/XMLDocument_adoptNode_dtd_declarations.phpt\n- ASAN_OPTIONS=detect_leaks=0
USE_ZEND_ALLOC=0 sapi/cli/php run-tests.php -q ext/dom/tests/DOMDocument_adoptNode.phpt
ext/dom/tests/modern/spec/XMLDocument_adoptNode_dtd_declarations.phpt\n\nBoth focused tests pass.