Bug #69420 [Opn->Csd]: Invalid read in zend_std_get_method

From: Date: Fri, 10 Apr 2015 14:59:48 +0000
Subject: Bug #69420 [Opn->Csd]: Invalid read in zend_std_get_method
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191938@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69420&edit=1 ID: 69420 Updated by: laruence@php.net Reported by: laruence@php.net Summary: Invalid read in zend_std_get_method -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem PHP Version: 5.5.23 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=429f411eb39b1898a87efb0839f74f6e7c7d6ea1 Log: Fixed bug #69420 (Invalid read in zend_std_get_method) Previous Comments: ------------------------------------------------------------------------ [2015-04-10 14:53:39] derick@php.net This is also a problem in PHP 5.4 and 5.6. ------------------------------------------------------------------------ [2015-04-10 14:50:29] laruence@php.net Description: ------------ none Test script: --------------- <?php trait T { protected function test() {} } class A { protected function test() { } } class B extends A { use T; public function foo() { $this->test(); } } $b = new B(); $b->foo(); Expected result: ---------------- nothing with valgrind Actual result: -------------- ==6262== Invalid read of size 8 ==6262== at 0x84CF2B: zend_std_get_method (zend_object_handlers.c:1103) ==6262== by 0x86C9B4: ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER (zend_vm_execute.h:25480) ==6262== by 0x85D207: execute_ex (zend_vm_execute.h:363) ==6262== by 0x8243DF: zend_execute_scripts (zend.c:1341) ==6262== by 0x7C2121: php_execute_script (main.c:2597) ==6262== by 0x8C83EE: do_cli (php_cli.c:994) ==6262== by 0x4415CF: main (php_cli.c:1378) ==6262== Address 0xf7a3940 is 16 bytes inside a block of size 248 free'd ==6262== at 0x4C2CE8E: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6262== by 0x82FB0C: _zend_hash_quick_add_or_update (zend_hash.c:335) ==6262== by 0x803D49: zend_add_trait_method (zend_compile.c:4088) ==6262== by 0x804477: zend_traits_copy_functions (zend_compile.c:4187) ==6262== by 0x830A07: zend_hash_apply_with_arguments (zend_hash.c:701) ==6262== by 0x80754D: zend_do_bind_traits (zend_compile.c:4357) ==6262== by 0x864E33: ZEND_BIND_TRAITS_SPEC_HANDLER (zend_vm_execute.h:1163) ==6262== by 0x85D207: execute_ex (zend_vm_execute.h:363) ==6262== by 0x8243DF: zend_execute_scripts (zend.c:1341) ==6262== by 0x7C2121: php_execute_script (main.c:2597) ==6262== by 0x8C83EE: do_cli (php_cli.c:994) ==6262== by 0x4415CF: main (php_cli.c:1378) ==6262== ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69420&edit=1

« previous php.bugs (#191938) next »