cvs: ZendEngine2 / zend_builtin_functions.c

From: Date: Tue, 27 Jul 2004 01:33:25 +0000
Subject: cvs: ZendEngine2 / zend_builtin_functions.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2804@lists.php.net to get a copy of this message
wez Mon Jul 26 21:33:25 2004 EDT Modified files: /ZendEngine2 zend_builtin_functions.c Log: Fix two possible crashes. Latter is unlikely unless you are doing scary things, but former looks nasty. http://cvs.php.net/diff.php/ZendEngine2/zend_builtin_functions.c?r1=1.241&r2=1.242&ty=u Index: ZendEngine2/zend_builtin_functions.c diff -u ZendEngine2/zend_builtin_functions.c:1.241 ZendEngine2/zend_builtin_functions.c:1.242 --- ZendEngine2/zend_builtin_functions.c:1.241 Wed Jul 21 18:13:31 2004 +++ ZendEngine2/zend_builtin_functions.c Mon Jul 26 21:33:25 2004 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_builtin_functions.c,v 1.241 2004/07/21 22:13:31 edink Exp $ */ +/* $Id: zend_builtin_functions.c,v 1.242 2004/07/27 01:33:25 wez Exp $ */ #include "zend.h" #include "zend_API.h" @@ -671,9 +671,10 @@ if (zend_lookup_class(Z_STRVAL_PP(class_name), Z_STRLEN_PP(class_name), &pce TSRMLS_CC) == FAILURE) { RETURN_FALSE; } else { - int count = zend_hash_num_elements(&ce->default_properties); + int count; ce = *pce; + count = zend_hash_num_elements(&ce->default_properties); array_init(return_value); if (count > 0) { @@ -1680,6 +1681,11 @@ /* i know this is kinda ugly, but i'm trying to avoid extra cycles in the main execution loop */ zend_bool build_filename_arg = 1; + if (!ptr->opline) { + /* can happen when calling eval from a custom sapi */ + function_name = "unknown"; + build_filename_arg = 0; + } else switch (ptr->opline->op2.u.constant.value.lval) { case ZEND_EVAL: function_name = "eval";

« previous php.zend-engine.cvs (#2804) next »