mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
- Fixed bug #53362 (Segmentation fault when extending SplFixedArray)
This commit is contained in:
parent
61d97af18b
commit
f16059d697
3 changed files with 28 additions and 1 deletions
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
||||||
PHP NEWS
|
PHP NEWS
|
||||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||
?? ??? 2010, PHP 5.3.4
|
?? ??? 2010, PHP 5.3.4
|
||||||
|
- Fixed bug #53362 (Segmentation fault when extending SplFixedArray). (Felipe)
|
||||||
- Fixed bug #47168 (printf of floating point variable prints maximum of 40
|
- Fixed bug #47168 (printf of floating point variable prints maximum of 40
|
||||||
decimal places). (Ilia)
|
decimal places). (Ilia)
|
||||||
|
|
||||||
|
|
|
@ -409,7 +409,11 @@ static void spl_fixedarray_object_write_dimension(zval *object, zval *offset, zv
|
||||||
intern = (spl_fixedarray_object *)zend_object_store_get_object(object TSRMLS_CC);
|
intern = (spl_fixedarray_object *)zend_object_store_get_object(object TSRMLS_CC);
|
||||||
|
|
||||||
if (intern->fptr_offset_set) {
|
if (intern->fptr_offset_set) {
|
||||||
|
if (!offset) {
|
||||||
|
ALLOC_INIT_ZVAL(offset);
|
||||||
|
} else {
|
||||||
SEPARATE_ARG_IF_REF(offset);
|
SEPARATE_ARG_IF_REF(offset);
|
||||||
|
}
|
||||||
SEPARATE_ARG_IF_REF(value);
|
SEPARATE_ARG_IF_REF(value);
|
||||||
zend_call_method_with_2_params(&object, intern->std.ce, &intern->fptr_offset_set, "offsetSet", NULL, offset, value);
|
zend_call_method_with_2_params(&object, intern->std.ce, &intern->fptr_offset_set, "offsetSet", NULL, offset, value);
|
||||||
zval_ptr_dtor(&value);
|
zval_ptr_dtor(&value);
|
||||||
|
|
22
ext/spl/tests/bug53362.phpt
Normal file
22
ext/spl/tests/bug53362.phpt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #53362 (Segmentation fault when extending SplFixedArray)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class obj extends SplFixedArray{
|
||||||
|
public function offsetSet($offset, $value) {
|
||||||
|
var_dump($offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$obj = new obj;
|
||||||
|
|
||||||
|
$obj[]=2;
|
||||||
|
$obj[]=2;
|
||||||
|
$obj[]=2;
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
NULL
|
||||||
|
NULL
|
||||||
|
NULL
|
Loading…
Add table
Add a link
Reference in a new issue