summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-04-01 19:13:04 +0000
committerAntony Dovgal <tony2001@php.net>2006-04-01 19:13:04 +0000
commit9a59df13cc1a779bcd3d9ea1e775ca0e79293c82 (patch)
tree3eac3d751f9775b8f2d2057787fa8d3042f519ca /ext/spl/spl_array.c
parent8ccdceb4db1a2e979c16b1dc7314f44c51ab7c0c (diff)
downloadphp-git-9a59df13cc1a779bcd3d9ea1e775ca0e79293c82.tar.gz
fix segfault when assigning value by ref and add test
(I consider it's wrong that we can't do it, but we shouldn't segfault anyway)
Diffstat (limited to 'ext/spl/spl_array.c')
-rwxr-xr-xext/spl/spl_array.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 4b17419246..cb450b1eab 100755
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -219,6 +219,10 @@ static zval **spl_array_get_dimension_ptr_ptr(int check_inherited, zval *object,
if (check_inherited && intern->fptr_offset_get) {
return zend_call_method_with_1_params(&object, Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", NULL, offset);
}*/
+
+ if (!offset) {
+ return &EG(uninitialized_zval_ptr);
+ }
switch(Z_TYPE_P(offset)) {
case IS_STRING: