cvs: ZendEngine2(PHP_5_2) / zend_execute.c
| From: | Antony Dovgal | Date: | Wed, 27 Jun 2007 08:51:40 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_execute.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5856@lists.php.net to get a copy of this message | ||
tony2001 Wed Jun 27 08:51:40 2007 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend_execute.c
Log:
fix #41813 (segmentation fault when using string offset as an object)
patch by judas dot iscariote at gmail dot com
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_execute.c?r1=1.716.2.12.2.20&r2=1.716.2.12.2.21&diff_format=u
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.716.2.12.2.20 ZendEngine2/zend_execute.c:1.716.2.12.2.21
--- ZendEngine2/zend_execute.c:1.716.2.12.2.20 Wed Jun 6 08:35:23 2007
+++ ZendEngine2/zend_execute.c Wed Jun 27 08:51:40 2007
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_execute.c,v 1.716.2.12.2.20 2007/06/06 08:35:23 tony2001 Exp $ */
+/* $Id: zend_execute.c,v 1.716.2.12.2.21 2007/06/27 08:51:40 tony2001 Exp $ */
#define ZEND_INTENSIVE_DEBUGGING 0
@@ -530,6 +530,10 @@
zval *value = get_zval_ptr(value_op, Ts, &free_value, BP_VAR_R);
zval **retval = &T(result->u.var).var.ptr;
+ if (!object_ptr) {
+ zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
+ }
+
if (*object_ptr == EG(error_zval_ptr)) {
FREE_OP(free_op2);
if (!RETURN_VALUE_UNUSED(result)) {