cvs: ZendEngine2(PHP_5_2) / zend_compile.c php-src NEWS
| From: | Dmitry Stogov | Date: | Fri, 04 May 2007 06:18:54 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_compile.c php-src NEWS | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5770@lists.php.net to get a copy of this message | ||
dmitry Fri May 4 06:18:54 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src NEWS
/ZendEngine2 zend_compile.c
Log:
Fixed altering $this via argument named "this"
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.676&r2=1.2027.2.547.2.677&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.676 php-src/NEWS:1.2027.2.547.2.677
--- php-src/NEWS:1.2027.2.547.2.676 Thu May 3 23:38:27 2007
+++ php-src/NEWS Fri May 4 06:18:52 2007
@@ -3,6 +3,7 @@
?? ??? 2007, PHP 5.2.3
- Fixed ext/filter Email Validation Vulnerability (MOPB-24 by Stefan Esser)
(Ilia)
+- Fixed altering $this via argument named "this". (Dmitry)
03 May 2007, PHP 5.2.2
- Improved bundled GD
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_compile.c?r1=1.647.2.27.2.37&r2=1.647.2.27.2.38&diff_format=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.647.2.27.2.37 ZendEngine2/zend_compile.c:1.647.2.27.2.38
--- ZendEngine2/zend_compile.c:1.647.2.27.2.37 Wed May 2 17:24:15 2007
+++ ZendEngine2/zend_compile.c Fri May 4 06:18:53 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.647.2.27.2.37 2007/05/02 17:24:15 dmitry Exp $ */
+/* $Id: zend_compile.c,v 1.647.2.27.2.38 2007/05/04 06:18:53 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -1265,9 +1265,18 @@
void zend_do_receive_arg(zend_uchar op, znode *var, znode *offset, znode *initialization, znode
*class_type, znode *varname, zend_uchar pass_by_reference TSRMLS_DC)
{
- zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ zend_op *opline;
zend_arg_info *cur_arg_info;
+ if (CG(active_op_array)->scope &&
+ ((CG(active_op_array)->fn_flags & ZEND_ACC_STATIC) == 0) &&
+ (Z_TYPE(varname->u.constant) == IS_STRING) &&
+ (Z_STRLEN(varname->u.constant) == sizeof("this")-1) &&
+ (memcmp(Z_STRVAL(varname->u.constant), "this", sizeof("this")) == 0)) {
+ zend_error(E_COMPILE_ERROR, "Cannot re-assign $this");
+ }
+
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
CG(active_op_array)->num_args++;
opline->opcode = op;
opline->result = *var;