|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2020-08-13 11:06 UTC] nikic@php.net
 Description: ------------ <?php $cdata = new DOMText; $cdata->before(null); ==441255== Invalid read of size 4 ==441255== at 0x488E30: dom_zvals_to_fragment (parentnode.c:137) ==441255== by 0x489514: dom_parent_node_before (parentnode.c:339) ==441255== by 0x494744: zim_DOMCharacterData_before (characterdata.c:428) ==441255== by 0x9FA8B4: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1618) ==441255== by 0xA678B8: execute_ex (zend_vm_execute.h:53562) ==441255== by 0xA6CA21: zend_execute (zend_vm_execute.h:57766) ==441255== by 0x9C134B: zend_execute_scripts (zend.c:1696) ==441255== by 0x923E4E: php_execute_script (main.c:2535) ==441255== by 0xAABE2F: do_cli (php_cli.c:949) ==441255== by 0xAACE6E: main (php_cli.c:1336) ==441255== Address 0x8 is not stack'd, malloc'd or (recently) free'd PatchesPull Requests
Pull requests: HistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 07:00:01 2025 UTC | 
According to the spec, for an element that has its hierachy preconditions fail an exception should be thrown: node . before(...nodes) Inserts nodes just before node, while replacing strings in nodes with equivalent Text nodes. Throws a "HierarchyRequestError" DOMException if the constraints of the node tree are violated. It looks this is not implemented and causes the segfault.