Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c
| From: | Andi Gutmans | Date: | Mon, 21 Jul 2003 05:32:25 +0000 |
| Subject: | Re: [ZEND-ENGINE-CVS] cvs: ZendEngine2 / zend_execute.c | ||
| References: | 1 | Groups: | php.zend-engine.cvs |
| Request: | Send a blank email to php-zend-engine-cvs+get-1505@lists.php.net to get a copy of this message | ||
This patch doesn't seem right. You shouldn't be checking the resulting string str.val and str.len. If the value is converted to a string it should always have a value and worst case you do a hash lookup with "" and then error out because it's not found.
Please revert this patch and let's discuss a different way of fixing this.
Andi
At 08:45 PM 20/7/2003 +0000, Marcus Boerger wrote:
helly Sun Jul 20 16:45:59 2003 EDTModified files:/ZendEngine2 zend_execute.cLog: Bugfix #24729 = new ; causes crash when is not set Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.493 ZendEngine2/zend_execute.c:1.494--- ZendEngine2/zend_execute.c:1.493 Sun Jul 20 13:46:21 2003+++ ZendEngine2/zend_execute.c Sun Jul 20 16:45:59 2003 @@ -17,7 +17,7 @@+----------------------------------------------------------------------+*/ -/* $Id: zend_execute.c,v 1.493 2003/07/20 17:46:21 helly Exp $ */ +/* $Id: zend_execute.c,v 1.494 2003/07/20 20:45:59 helly Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -2380,21 +2380,21 @@if (class_name->type == IS_OBJECT) { ce = Z_OBJCE_P(class_name); - } else { + } else if (class_name->value.str.val && class_name->value.str.len) { class_name_strval = zend_str_tolower_dup(class_name->value.str.val, class_name->value.str.len); class_name_strlen = class_name->value.str.len; free_class_name = 1; + } else { + class_name_strval = ""; + class_name_strlen = 0; } }if (!ce) { - int retval;-- if (EX(opline)->op1.op_type == IS_UNUSED) { - retval = zend_lookup_class(class_name_strval, class_name_strlen, &pce TSRMLS_CC); - } - if (retval==SUCCESS) { - ce = *pce; + if (EX(opline)->op1.op_type == IS_UNUSED && class_name->value.str.val && class_name->value.str.len) { + if (zend_lookup_class(class_name_strval, class_name_strlen, &pce TSRMLS_CC) == SUCCESS) { + ce = *pce; + } } }-- Zend Engine CVS Mailing List (http://cvs.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php