properties). (Laruence)
. Fixed misparsing of abstract unix domain socket names. (Sara)
+- DOM:
+ . Fixed bug #69373 (References to deleted XPath query results). (ttoohey)
+
- Intl:
. Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex)
case XML_ATTRIBUTE_NODE:
if (nodep->children) {
node_list_unlink(nodep->children);
+ php_libxml_node_free_list((xmlNodePtr) nodep->children);
+ nodep->children = NULL;
}
case XML_TEXT_NODE:
case XML_COMMENT_NODE:
return FAILURE;
}
+ if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE) {
+ if (nodep->children) {
+ node_list_unlink(nodep->children);
+ php_libxml_node_free_list((xmlNodePtr) nodep->children);
+ nodep->children = NULL;
+ }
+ }
+
str = zval_get_string(newval);
/* we have to use xmlNodeAddContent() to get the same behavior as with xmlNewText() */
xmlNodeSetContent(nodep, (xmlChar *) "");
--- /dev/null
+--TEST--
+Bug #69373 References to deleted XPath query results
+--FILE--
+<?php
+$doc = new DOMDocument();
+for( $i=0; $i<20; $i++ ) {
+ $doc->loadXML("<parent><child /><child /></parent>");
+ $xpath = new DOMXpath($doc);
+ $all = $xpath->query('//*');
+ $doc->firstChild->nodeValue = '';
+}
+echo 'DONE', PHP_EOL;
+?>
+--EXPECT--
+DONE
}
}
-static void php_libxml_node_free_list(xmlNodePtr node)
+PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)
{
xmlNodePtr curnode;
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object);
PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
/* When an explicit freeing of node and children is required */
+PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node);
PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node);
/* When object dtor is called as node may still be referenced */
PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object);