Re: cvs: php-src /ext/spl spl_fastarray.c
| From: | Marcus Boerger | Date: | Sat, 07 Jun 2008 18:59:42 +0000 |
| Subject: | Re: cvs: php-src /ext/spl spl_fastarray.c | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-50317@lists.php.net to get a copy of this message | ||
Hello Antony,
Saturday, June 7, 2008, 2:46:54 PM, you wrote:
> tony2001 Sat Jun 7 12:46:54 2008 UTC
> Modified files:
> /php-src/ext/spl spl_fastarray.c
> Log:
> disallow $a[] = value syntax
>
>
>
> http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_fastarray.c?r1=1.2&r2=1.3&diff_format=u
> Index: php-src/ext/spl/spl_fastarray.c
> diff -u php-src/ext/spl/spl_fastarray.c:1.2 php-src/ext/spl/spl_fastarray.c:1.3
> --- php-src/ext/spl/spl_fastarray.c:1.2 Sat Jun 7 01:46:27 2008
> +++ php-src/ext/spl/spl_fastarray.c Sat Jun 7 12:46:54 2008
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: spl_fastarray.c,v 1.2 2008/06/07 01:46:27 colder Exp $ */
> +/* $Id: spl_fastarray.c,v 1.3 2008/06/07 12:46:54 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);
Why not use OverflowException here?
> + return;
> + }
> +
> index = spl_offset_convert_to_long(offset TSRMLS_CC);
>
> if (index < 0 || index >= intern->array->size) {
Best regards,
Marcus