tony2001                Sat Apr  1 19:13:04 2006 UTC

  Added files:                 (Branch: PHP_5_1)
    /php-src/ext/spl/tests      iterator_035.phpt 

  Modified files:              
    /php-src/ext/spl    spl_array.c 
  Log:
  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)
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.14&r2=1.71.2.15&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.71.2.14 
php-src/ext/spl/spl_array.c:1.71.2.15
--- php-src/ext/spl/spl_array.c:1.71.2.14       Wed Mar 29 14:28:42 2006
+++ php-src/ext/spl/spl_array.c Sat Apr  1 19:13:04 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.71.2.14 2006/03/29 14:28:42 tony2001 Exp $ */
+/* $Id: spl_array.c,v 1.71.2.15 2006/04/01 19:13:04 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -219,6 +219,10 @@
        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:

http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/tests/iterator_035.phpt?view=markup&rev=1.1
Index: php-src/ext/spl/tests/iterator_035.phpt
+++ php-src/ext/spl/tests/iterator_035.phpt

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to