com php-src: Fix use-after-free of ZCG(cwd) in Zend Optimizer: ext/opcache/ZendAccelerator.c

From: Date: Wed, 10 Feb 2016 09:33:57 +0000
Subject: com php-src: Fix use-after-free of ZCG(cwd) in Zend Optimizer: ext/opcache/ZendAccelerator.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-91024@lists.php.net to get a copy of this message
Commit: 35f6f9b0dbc683812badf3a8e38d1ec110fd7925 Author: Yussuf Khalil <dev@pp3345.net> Wed, 10 Feb 2016 10:33:57 +0100 Parents: c339d5217aa1966689424c911c8f455652861bf7 Branches: PHP-5.6 PHP-7.0 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=35f6f9b0dbc683812badf3a8e38d1ec110fd7925 Log: Fix use-after-free of ZCG(cwd) in Zend Optimizer Changed paths: M ext/opcache/ZendAccelerator.c Diff: diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 66b54f2..0f66c56 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2370,6 +2370,11 @@ static void accel_deactivate(void) */ TSRMLS_FETCH(); + if (ZCG(cwd)) { + efree(ZCG(cwd)); + ZCG(cwd) = NULL; + } + if (!ZCG(enabled) || !accel_startup_ok) { return; } @@ -2383,12 +2388,6 @@ static void accel_deactivate(void) zend_accel_fast_shutdown(TSRMLS_C); } #endif - - if (ZCG(cwd)) { - efree(ZCG(cwd)); - ZCG(cwd) = NULL; - } - } static int accelerator_remove_cb(zend_extension *element1, zend_extension *element2)

« previous php.cvs (#91024) next »