com php-src: Fixed usage after free: ext/opcache/zend_acceler ator_util_funcs.c

From: Date: Wed, 30 Jul 2014 06:39:25 +0000
Subject: com php-src: Fixed usage after free: ext/opcache/zend_acceler ator_util_funcs.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-79651@lists.php.net to get a copy of this message
Commit: aa3ddda8e504dd2a01e6fa786efda7d3888a9241 Author: Dmitry Stogov <dmitry@zend.com> Wed, 30 Jul 2014 10:39:25 +0400 Parents: ab4c4c3970f3c9d03a4f65a923fb31618d08a2c8 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aa3ddda8e504dd2a01e6fa786efda7d3888a9241 Log: Fixed usage after free Changed paths: M ext/opcache/zend_accelerator_util_funcs.c Diff: diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index dbab902..a0bc76d 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -979,7 +979,6 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, if (zend_hash_num_elements(&persistent_script->class_table) > 0) { zend_accel_class_hash_copy(CG(class_table), &persistent_script->class_table, NULL TSRMLS_CC); } - free_persistent_script(persistent_script, 0); /* free only hashes */ } #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO @@ -991,6 +990,10 @@ zend_op_array* zend_accel_load_script(zend_persistent_script *persistent_script, } #endif + if (!from_shared_memory) { + free_persistent_script(persistent_script, 0); /* free only hashes */ + } + return op_array; }

« previous php.cvs (#79651) next »