|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-04-02 14:23 UTC] cmb@php.net
-Status: Open
+Status: Verified
-PHP Version: 8.0.3
+PHP Version: 7.4
-Assigned To:
+Assigned To: cmb
[2021-04-02 14:23 UTC] cmb@php.net
[2021-04-03 15:50 UTC] jking at jkingweb dot ca
[2021-04-06 13:41 UTC] cmb@php.net
-Assigned To: cmb
+Assigned To:
[2021-04-06 13:41 UTC] cmb@php.net
[2023-08-12 16:49 UTC] git@php.net
[2023-08-12 16:49 UTC] git@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 18:00:01 2025 UTC |
Description: ------------ See test script. While it is somewhat contrived, it is a situation I ran into setting up unit tests. When removing the document element out from under an attribute node, the namespaceURI and prefix properties of the DOMAttr will contain garbage bytes instead of the specified values. As the prefix property is writeable it may be possible to corrupt memory this way, though I have not confirmed this. Test script: --------------- $d = new \DOMDocument(); $d->appendChild($d->createElement("html")); $a = $d->createAttributeNS("fake_ns", "test:test"); $d->removeChild($d->documentElement); echo $a->namespaceURI; echo $a->prefix; Expected result: ---------------- Obviously I would expect the namespaceURI and prefix properties not to be corrupted. Given the apparent underlying limitations of libxml I might expect an exception to be thrown when trying to remove the document element.