Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
* PHP-8.2:
  Fix GH-14741: Segmentation fault in Zend/zend_types.h
  • Loading branch information
nielsdos committed Jul 8, 2024
2 parents 192c102 + eb8c3cb commit 4c95cb3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ PHP NEWS
. Fixed bug GH-14590 (Memory leak in FPM test gh13563-conf-bool-env.phpt.
(nielsdos)
. Fixed OSS-Fuzz #69765. (nielsdos)
. Fixed bug GH-14741 (Segmentation fault in Zend/zend_types.h). (nielsdos)

- Dom:
. Fixed bug GH-14702 (DOMDocument::xinclude() crash). (nielsdos)
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ ZEND_API void zend_register_interfaces(void)

memcpy(&zend_internal_iterator_handlers, zend_get_std_object_handlers(),
sizeof(zend_object_handlers));
zend_internal_iterator_handlers.clone_obj = NULL;
zend_internal_iterator_handlers.free_obj = zend_internal_iterator_free;
}
/* }}} */
17 changes: 17 additions & 0 deletions ext/zend_test/tests/gh14741.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
--TEST--
GH-14741 (Segmentation fault in Zend/zend_types.h)
--EXTENSIONS--
zend_test
--FILE--
<?php
$subject = new \ZendTest\Iterators\TraversableTest();
$it = $subject->getIterator();
try {
clone $it;
} catch (Error $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
Trying to clone an uncloneable object of class InternalIterator
TraversableTest::drop

0 comments on commit 4c95cb3

Please sign in to comment.