summaryrefslogtreecommitdiff
path: root/ext/spl/spl_fixedarray.c
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-11-19 20:07:32 (GMT)
committerFelipe Pena <felipe@php.net>2010-11-19 20:07:32 (GMT)
commit9608da9443965f8be8d611e1377bd2dff8ae2538 (patch)
treeb434a38aef39dd5f7d3495f51c176840b4ebe4d9 /ext/spl/spl_fixedarray.c
parente245652b6371087d236e13f417cabec3fa5f9386 (diff)
downloadphp-9608da9443965f8be8d611e1377bd2dff8ae2538.tar.gz
- Fixed bug #53362 (Segmentation fault when extending SplFixedArray)
Diffstat (limited to 'ext/spl/spl_fixedarray.c')
-rw-r--r--ext/spl/spl_fixedarray.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index 4389d50..94e9341 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -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);
if (intern->fptr_offset_set) {
- SEPARATE_ARG_IF_REF(offset);
+ if (!offset) {
+ ALLOC_INIT_ZVAL(offset);
+ } else {
+ SEPARATE_ARG_IF_REF(offset);
+ }
SEPARATE_ARG_IF_REF(value);
zend_call_method_with_2_params(&object, intern->std.ce, &intern->fptr_offset_set, "offsetSet", NULL, offset, value);
zval_ptr_dtor(&value);