diff options
author | Michael Wallner <mike@php.net> | 2013-10-03 13:29:18 +0200 |
---|---|---|
committer | Michael Wallner <mike@php.net> | 2013-10-03 13:29:18 +0200 |
commit | 86f2b336294b2ceaac76b9d0f5ed4eaf05e73156 (patch) | |
tree | bd6632184b8f81a4a90f221f4f1de233ebbbef80 /ext/xmlreader | |
parent | 60d9175280cbab5967966e38f42fced854d10408 (diff) | |
parent | fc3f8a8f54d8b3c864125bf32028d4550882839c (diff) | |
download | php-git-86f2b336294b2ceaac76b9d0f5ed4eaf05e73156.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
fix bug #59613 (Crash with clone XMLReader)
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 |