forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix phpGH-17409: Assertion failure Zend/zend_hash.c:1730
The array merging function may still hold the properties array while the object is already being destroyed. Therefore, we should take into account the refcount in simplexml's destruction code. It may be possible to trigger this in other ways too.
- Loading branch information
Showing
2 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--TEST-- | ||
GH-17409 (Assertion failure Zend/zend_hash.c) | ||
--EXTENSIONS-- | ||
simplexml | ||
--CREDITS-- | ||
YuanchengJiang | ||
--FILE-- | ||
<?php | ||
$root = simplexml_load_string('<?xml version="1.0"?> | ||
<root xmlns:reserved="reserved-ns"> | ||
<child reserved:attribute="Sample" /> | ||
</root> | ||
'); | ||
// Need to use $GLOBALS such that simplexml object is destroyed | ||
var_dump(array_merge_recursive($GLOBALS, $GLOBALS)["root"]); | ||
?> | ||
--EXPECT-- | ||
array(1) { | ||
["child"]=> | ||
array(0) { | ||
} | ||
} |