com php-src: Fixed segfault with file_cache_only: ext/o pcache/zend_shared_alloc.c
| From: | Anatol Belski | Date: | Sun, 28 Feb 2016 14:54:01 +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-91208@lists.php.net to get a copy of this message | ||
Commit: 6adfc20f04d3d3d4a0e85896b1651f8613a790c3
Author: Xinchen Hui <laruence@gmail.com> Sun, 28 Feb 2016 11:50:06 +0800
Committer: Anatol Belski <ab@php.net> Sun, 28 Feb 2016 15:54:01 +0100
Parents: e2bf86fbfd97d30abd2b32ac0658f8ebcc318141
Branches: PHP-7.0.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6adfc20f04d3d3d4a0e85896b1651f8613a790c3
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)
{