com php-src: Fixed segfault with file_cache_only: ext/o pcache/zend_shared_alloc.c
| From: | Xinchen Hui | Date: | Sun, 28 Feb 2016 03:50:06 +0000 |
| Subject: | com php-src: Fixed segfault with file_cache_only: ext/o pcache/zend_shared_alloc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91172@lists.php.net to get a copy of this message | ||
Commit: 8c053d44e473f6b9e65d50ce81029b5849d9e105
Author: Xinchen Hui <laruence@gmail.com> Sun, 28 Feb 2016 11:50:06 +0800
Parents: c299b272c77b9bea4d6371a37a6d2b894f9729e8
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8c053d44e473f6b9e65d50ce81029b5849d9e105
Log:
Fixed segfault with file_cache_only
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 6625fe2..deae886 100644
--- a/ext/opcache/zend_shared_alloc.c
+++ b/ext/opcache/zend_shared_alloc.c
@@ -512,6 +512,10 @@ int zend_accel_in_shm(void *ptr)
{
int i;
+ if (!smm_shared_globals) {
+ return 0;
+ }
+
for (i = 0; i < ZSMMG(shared_segments_count); i++) {
if ((char*)ptr >= (char*)ZSMMG(shared_segments)[i]->p &&
(char*)ptr < (char*)ZSMMG(shared_segments)[i]->p + ZSMMG(shared_segments)[i]->size)
{