com php-src: Fixed bug #69420 (Invalid read in zend_std_get _method): NEWS Zend/tests/bug69420.phpt Zend/zend_compile.c

From: Date: Fri, 10 Apr 2015 14:47:06 +0000
Subject: com php-src: Fixed bug #69420 (Invalid read in zend_std_get _method): NEWS Zend/tests/bug69420.phpt Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86156@lists.php.net to get a copy of this message
Commit: 429f411eb39b1898a87efb0839f74f6e7c7d6ea1 Author: Xinchen Hui <laruence@php.net> Fri, 10 Apr 2015 22:47:06 +0800 Parents: 741c5e4c0c4d666469215d21de8a743a6b292fa2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=429f411eb39b1898a87efb0839f74f6e7c7d6ea1 Log: Fixed bug #69420 (Invalid read in zend_std_get_method) Bugs: https://bugs.php.net/69420 Changed paths: M NEWS A Zend/tests/bug69420.phpt M Zend/zend_compile.c Diff: diff --git a/NEWS b/NEWS index f28c88e..aaab16a 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP NEWS ?? ??? 2015, PHP 5.5.25 - Core: + . Fixed bug #69420 (Invalid read in zend_std_get_method). (Laruence) . Fixed bug #60022 ("use statement [...] has no effect" depends on leading backslash). (Nikita) . Fixed bug #67314 (Segmentation fault in gc_remove_zval_from_buffer). diff --git a/Zend/tests/bug69420.phpt b/Zend/tests/bug69420.phpt new file mode 100644 index 0000000...060d69c --- /dev/null +++ b/Zend/tests/bug69420.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #69420 (Invalid read in zend_std_get_method) +--FILE-- +<?php + +trait T { + protected function test() { + echo "okey"; + } +} + + +class A { + protected function test() { + } +} + +class B extends A { + use T; + public function foo() { + $this->test(); + } +} + + +$b = new B(); +$b->foo(); +?> +--EXPECT-- +okey diff --git a/Zend/zend_compile..c b/Zend/zend_compile.c index 94566a5..4e61f5f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3942,6 +3942,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name, const /* inherited members are overridden by members inserted by traits */ /* check whether the trait method fulfills the inheritance requirements */ do_inheritance_check_on_method(fn, existing_fn TSRMLS_CC); + fn->common.prototype = NULL; } }

« previous php.cvs (#86156) next »