summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-02-25 18:14:22 +0800
committerXinchen Hui <laruence@gmail.com>2014-02-25 18:14:22 +0800
commit499b553c18f1e4e7c09c5f8a20ddc78b7ce70309 (patch)
tree9cc9791e5d3faee9d37fb4dfd0c05c223ea942d0
parent595741f6ece88c79d368a20c14786268a8e35434 (diff)
downloadphp-git-499b553c18f1e4e7c09c5f8a20ddc78b7ce70309.tar.gz
Fixed NULL pointer dereference
-rw-r--r--Zend/zend_execute_API.c4
-rw-r--r--ext/standard/incomplete_class.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 7fb89bc046..425a04756b 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 d8aa461b05..3cbe70479d 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");
}
}
/* }}} */