From: Xinchen Hui Date: Tue, 25 Feb 2014 10:14:22 +0000 (+0800) Subject: Fixed NULL pointer dereference X-Git-Tag: POST_PHPNG_MERGE~412^2~533^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=499b553c18f1e4e7c09c5f8a20ddc78b7ce70309;p=php Fixed NULL pointer dereference --- 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"); } } /* }}} */