com php-src: Fixed NULL pointer dereference: Zend/zend_execut e_API.c ext/standard/incomplete_class.c
| From: | Dmitry Stogov | Date: | Tue, 25 Feb 2014 10:14:22 +0000 |
| Subject: | com php-src: Fixed NULL pointer dereference: Zend/zend_execut e_API.c ext/standard/incomplete_class.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77929@lists.php.net to get a copy of this message | ||
Commit: 499b553c18f1e4e7c09c5f8a20ddc78b7ce70309
Author: Xinchen Hui <laruence@gmail.com> Tue, 25 Feb 2014 18:14:22 +0800
Parents: 595741f6ece88c79d368a20c14786268a8e35434
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=499b553c18f1e4e7c09c5f8a20ddc78b7ce70309
Log:
Fixed NULL pointer dereference
Changed paths:
M Zend/zend_execute_API.c
M ext/standard/incomplete_class.c
Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 7fb89bc..425a047 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -371,10 +371,10 @@ ZEND_API const char *get_active_function_name(TSRMLS_D) /* {{{ */
}
switch (EG(current_execute_data)->function_state.function->type) {
case ZEND_USER_FUNCTION: {
- const char *function_name = ((zend_op_array *)
EG(current_execute_data)->function_state.function)->function_name->val;
+ zend_string *function_name = ((zend_op_array *)
EG(current_execute_data)->function_state.function)->function_name;
if (function_name) {
- return function_name;
+ return function_name->val;
} else {
return "main";
}
diff --git a/ext/standard/incomplete_class.c b/ext/standard/incomplete_class.c
index d8aa461..3cbe704 100644
--- a/ext/standard/incomplete_class.c
+++ b/ext/standard/incomplete_class..c
@@ -41,10 +41,10 @@ static void incomplete_class_message(zval *object, int error_type TSRMLS_DC)
class_name = php_lookup_class_name(object);
if (class_name) {
- php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, "unknown");
- } else {
php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, class_name->val);
STR_RELEASE(class_name);
+ } else {
+ php_error_docref(NULL TSRMLS_CC, error_type, INCOMPLETE_CLASS_MSG, "unknown");
}
}
/* }}} */