From 499b553c18f1e4e7c09c5f8a20ddc78b7ce70309 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Tue, 25 Feb 2014 18:14:22 +0800 Subject: [PATCH] Fixed NULL pointer dereference --- Zend/zend_execute_API.c | 4 ++-- ext/standard/incomplete_class.c | 4 ++-- 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"); } } /* }}} */ -- 2.40.0