1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 09:28:21 +02:00

Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.31 next
This commit is contained in:
Stanislav Malyshev
2014-06-10 23:20:07 -07:00
3 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -402,7 +402,7 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
/* When in a write context,
* ZE has to be fooled into thinking this is in a reference set
* by separating (if necessary) and returning as an is_ref=1 zval (even if refcount == 1) */
if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && !Z_ISREF_PP(ret)) {
if ((type == BP_VAR_W || type == BP_VAR_RW || type == BP_VAR_UNSET) && !Z_ISREF_PP(ret) && ret != &EG(uninitialized_zval_ptr)) {
if (Z_REFCOUNT_PP(ret) > 1) {
zval *newval;
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #66127 (Segmentation fault with ArrayObject unset)
--INI--
error_reporting = E_ALL & ~E_NOTICE
--FILE--
<?php
function crash()
{
set_error_handler(function () {});
$var = 1;
trigger_error('error');
$var2 = $var;
$var3 = $var;
trigger_error('error');
}
$items = new ArrayObject();
unset($items[0]);
unset($items[0][0]);
crash();
echo "Worked!\n";
?>
--EXPECT--
Worked!
+2
View File
@@ -12,4 +12,6 @@ $a[] = &$tmp;
echo "Done\n";
?>
--EXPECTF--
Notice: Indirect modification of overloaded element of ArrayIterator has no effect in %s on line %d
Fatal error: Cannot assign by reference to overloaded object in %s on line %d