summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2013-01-30 20:23:39 +0100
committerNikita Popov <nikic@php.net>2013-01-30 20:23:39 +0100
commit321f4f18e52bfabe19fb9217dff0bf661d48e5d3 (patch)
tree82c310b816b22c6969c5605adf2bf21cbdd18639 /ext/spl/spl_array.c
parentec53b60072799704a0d94cdd935bdf54bd5e5344 (diff)
downloadphp-git-321f4f18e52bfabe19fb9217dff0bf661d48e5d3.tar.gz
Fixed bug #64106: Segfault on SplFixedArray[][x] = y when extended
Diffstat (limited to 'ext/spl/spl_array.c')
-rw-r--r--ext/spl/spl_array.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 7c2e148f68..7d6f31427d 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -387,7 +387,11 @@ static zval *spl_array_read_dimension_ex(int check_inherited, zval *object, zval
spl_array_object *intern = (spl_array_object*)zend_object_store_get_object(object TSRMLS_CC);
if (intern->fptr_offset_get) {
zval *rv;
- SEPARATE_ARG_IF_REF(offset);
+ if (!offset) {
+ ALLOC_INIT_ZVAL(offset);
+ } else {
+ SEPARATE_ARG_IF_REF(offset);
+ }
zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset);
zval_ptr_dtor(&offset);
if (rv) {