tony2001                Sat Jun  7 12:47:05 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/spl    spl_fastarray.c 
  Log:
  MFH: disallow $a[] = value syntax
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.1.2.3&r2=1.1.2.4&diff_format=u
Index: php-src/ext/spl/spl_fastarray.c
diff -u php-src/ext/spl/spl_fastarray.c:1.1.2.3 
php-src/ext/spl/spl_fastarray.c:1.1.2.4
--- php-src/ext/spl/spl_fastarray.c:1.1.2.3     Sat Jun  7 01:46:44 2008
+++ php-src/ext/spl/spl_fastarray.c     Sat Jun  7 12:47:04 2008
@@ -17,7 +17,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: spl_fastarray.c,v 1.1.2.3 2008/06/07 01:46:44 colder Exp $ */
+/* $Id: spl_fastarray.c,v 1.1.2.4 2008/06/07 12:47:04 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -321,6 +321,12 @@
 {
        long index;
 
+       if (!offset) {
+               /* '$array[] = value' syntax is not supported */
+               zend_throw_exception(spl_ce_RuntimeException, "Index invalid or 
out of range", 0 TSRMLS_CC);
+               return;
+       }
+
        index = spl_offset_convert_to_long(offset TSRMLS_CC);
 
        if (index < 0 || index >= intern->array->size) {



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

Reply via email to