diff options
Diffstat (limited to 'ext/xmlreader')
-rw-r--r-- | ext/xmlreader/php_xmlreader.c | 1 | ||||
-rw-r--r-- | ext/xmlreader/tests/bug51963.phpt | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/ext/xmlreader/php_xmlreader.c b/ext/xmlreader/php_xmlreader.c index 02ebc7738e..464998ce62 100644 --- a/ext/xmlreader/php_xmlreader.c +++ b/ext/xmlreader/php_xmlreader.c @@ -1320,6 +1320,7 @@ PHP_MINIT_FUNCTION(xmlreader) xmlreader_object_handlers.read_property = xmlreader_read_property; xmlreader_object_handlers.write_property = xmlreader_write_property; xmlreader_object_handlers.get_property_ptr_ptr = xmlreader_get_property_ptr_ptr; + xmlreader_object_handlers.clone_obj = NULL; INIT_CLASS_ENTRY(ce, "XMLReader", xmlreader_functions); ce.create_object = xmlreader_objects_new; diff --git a/ext/xmlreader/tests/bug51963.phpt b/ext/xmlreader/tests/bug51963.phpt new file mode 100644 index 0000000000..af47f9750b --- /dev/null +++ b/ext/xmlreader/tests/bug51963.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug #59613 (Crash with clone XMLReader) +--SKIPIF-- +<?php +extension_loaded("xmlreader") or die("skip requires xmlreader"); +?> +--FILE-- +<?php +echo "Test\n"; + +$xmlreader = new XMLReader(); +$xmlreader->xml("<a><b/></a>"); + +$xmlreader->next(); +$xmlreader2 = clone $xmlreader; +$xmlreader2->next(); +?> +Done +--EXPECTF-- +Test + +Fatal error: Trying to clone an uncloneable object of class XMLReader in %s on line %d |