tony2001                Wed Mar 22 21:56:40 2006 UTC

  Modified files:              (Branch: PHP_5_1)
    /php-src/ext/spl    spl_array.c 
    /php-src    NEWS 
  Log:
  fix #36825 (Exceptions thrown in ArrayObject::offsetGet cause segfault)
  fix similar issue in offsetExists()
  remove redundant semicolons
  
  
http://cvs.php.net/viewcvs.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.10&r2=1.71.2.11&diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.71.2.10 
php-src/ext/spl/spl_array.c:1.71.2.11
--- php-src/ext/spl/spl_array.c:1.71.2.10       Sun Mar  5 17:39:49 2006
+++ php-src/ext/spl/spl_array.c Wed Mar 22 21:56:39 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: spl_array.c,v 1.71.2.10 2006/03/05 17:39:49 helly Exp $ */
+/* $Id: spl_array.c,v 1.71.2.11 2006/03/22 21:56:39 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
@@ -262,7 +262,11 @@
                        zend_call_method_with_1_params(&object, 
Z_OBJCE_P(object), &intern->fptr_offset_get, "offsetGet", &rv, offset); 
                        zval_ptr_dtor(&intern->retval);
                        MAKE_STD_ZVAL(intern->retval);
-                       ZVAL_ZVAL(intern->retval, rv, 1, 1);
+                       if (rv) {
+                               ZVAL_ZVAL(intern->retval, rv, 1, 1);
+                       } else {
+                               ZVAL_NULL(intern->retval);
+                       }
                        return intern->retval;
                }
        }
@@ -390,11 +394,13 @@
 
        if (check_inherited && intern->fptr_offset_has) {
                zend_call_method_with_1_params(&object, Z_OBJCE_P(object), 
&intern->fptr_offset_has, "offsetExists", &rv, offset);
-               if (zend_is_true(rv)) {
+               if (rv && zend_is_true(rv)) {
                        zval_ptr_dtor(&rv);
                        return 1;
                }
-               zval_ptr_dtor(&rv);
+               if (rv) {
+                       zval_ptr_dtor(&rv);
+               }
                return 0;
        }
        
@@ -1207,43 +1213,43 @@
 static
 ZEND_BEGIN_ARG_INFO(arginfo_array___construct, 0)
        ZEND_ARG_INFO(0, array)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetGet, 0, 0, 1)
        ZEND_ARG_INFO(0, index)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_array_offsetSet, 0, 0, 2)
        ZEND_ARG_INFO(0, index)
        ZEND_ARG_INFO(0, newval)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO(arginfo_array_append, 0)
        ZEND_ARG_INFO(0, value)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO(arginfo_array_seek, 0)
        ZEND_ARG_INFO(0, position)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO(arginfo_array_exchangeArray, 0)
        ZEND_ARG_INFO(0, array)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO(arginfo_array_setFlags, 0)
        ZEND_ARG_INFO(0, flags)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static
 ZEND_BEGIN_ARG_INFO(arginfo_array_setIteratorClass, 0)
        ZEND_ARG_INFO(0, iteratorClass)
-ZEND_END_ARG_INFO();
+ZEND_END_ARG_INFO()
 
 static zend_function_entry spl_funcs_ArrayObject[] = {
        SPL_ME(Array, __construct,   arginfo_array___construct, ZEND_ACC_PUBLIC)
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.477&r2=1.2027.2.478&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.477 php-src/NEWS:1.2027.2.478
--- php-src/NEWS:1.2027.2.477   Wed Mar 22 09:45:39 2006
+++ php-src/NEWS        Wed Mar 22 21:56:40 2006
@@ -10,6 +10,8 @@
   (also fixes bug #36764). (Tony)
 - Removed the E_STRICT deprecation notice from "var". (Ilia)
 - Fixed debug_zval_dump() to support private and protected members. (Dmitry)
+- Fixed bug #36825 (Exceptions thrown in ArrayObject::offsetGet cause 
+  segfault). (Tony)
 - Fixed bug #36820 (Privileged connection with an Oracle password file fails). 
   (Tony)
 - Fixed bug #36809 (__FILE__ behavior changed). (Dmitry)

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

Reply via email to