cvs: ZendEngine2 / zend_compile.c
| From: | Dmitry Stogov | Date: | Thu, 04 Aug 2005 14:04:36 +0000 |
| Subject: | cvs: ZendEngine2 / zend_compile.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3969@lists.php.net to get a copy of this message | ||
dmitry Thu Aug 4 10:04:36 2005 EDT
Modified files:
/ZendEngine2 zend_compile.c
Log:
Fixed possible memory corryption during compilation of <?php foreach($a as $b); ?>
http://cvs.php.net/diff.php/ZendEngine2/zend_compile.c?r1=1.646&r2=1.647&ty=u
Index: ZendEngine2/zend_compile.c
diff -u ZendEngine2/zend_compile.c:1.646 ZendEngine2/zend_compile.c:1.647
--- ZendEngine2/zend_compile.c:1.646 Wed Aug 3 09:30:48 2005
+++ ZendEngine2/zend_compile.c Thu Aug 4 10:04:36 2005
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_compile.c,v 1.646 2005/08/03 13:30:48 sniper Exp $ */
+/* $Id: zend_compile.c,v 1.647 2005/08/04 14:04:36 dmitry Exp $ */
#include <zend_language_parser.h>
#include "zend.h"
@@ -3469,7 +3469,8 @@
is_variable = 1;
}
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
- if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) {
+ if (CG(active_op_array)->last > 0 &&
+ CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) {
/* Only lock the container if we are fetching from a real container and not $this */
if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1.op_type == IS_VAR) {
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].extended_value |=
ZEND_FETCH_ADD_LOCK;