From: Antony Dovgal Date: Sat, 7 Jun 2008 12:47:04 +0000 (+0000) Subject: MFH: disallow $a[] = value syntax X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83d26fc47d6a551ea696b74d2c299548272486d6;p=php MFH: disallow $a[] = value syntax --- diff --git a/ext/spl/spl_fastarray.c b/ext/spl/spl_fastarray.c index ae1129c1ec..6449f0ddc2 100644 --- a/ext/spl/spl_fastarray.c +++ b/ext/spl/spl_fastarray.c @@ -321,6 +321,12 @@ static inline void spl_fastarray_object_write_dimension_helper(spl_fastarray_obj { 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) {