com php-src: Fixed bug #68677 (Use After Free in OPcache): ext/opcache/zend_shared_alloc.c
| From: | Lior Kaplan | Date: | Tue, 31 Mar 2015 22:24:16 +0000 |
| Subject: | com php-src: Fixed bug #68677 (Use After Free in OPcache): ext/opcache/zend_shared_alloc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85980@lists.php.net to get a copy of this message | ||
Commit: 0a8f28b43212cc2ddbc1f2df710e37b1bec0addd
Author: Xinchen Hui <laruence@php.net> Thu, 8 Jan 2015 16:32:20 +0800
Committer: Lior Kaplan <kaplanlior@gmail.com> Wed, 1 Apr 2015 01:24:16 +0300
Parents: ffbd380e4483a5b36733cfd99fab779008082d11
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0a8f28b43212cc2ddbc1f2df710e37b1bec0addd
Log:
Fixed bug #68677 (Use After Free in OPcache)
(cherry picked from commit 777c39f4042327eac4b63c7ee87dc1c7a09a3115)
Bugs:
https://bugs.php.net/68677
Changed paths:
M ext/opcache/zend_shared_alloc.c
Diff:
diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c
index bbe26e8..8880b88 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -346,10 +346,10 @@ void *_zend_shared_memdup(void *source, size_t size, zend_bool free_source
TSRML
retval = ZCG(mem);;
ZCG(mem) = (void*)(((char*)ZCG(mem)) + ZEND_ALIGNED_SIZE(size));
memcpy(retval, source, size);
+ zend_shared_alloc_register_xlat_entry(source, retval);
if (free_source) {
interned_efree((char*)source);
}
- zend_shared_alloc_register_xlat_entry(source, retval);
return retval;
}