diff --git a/ext/opcache/zend_accelerator_module.c b/ext/opcache/zend_accelerator_module.c index 2c0ad63b48f38..5c69c9f7883a2 100644 --- a/ext/opcache/zend_accelerator_module.c +++ b/ext/opcache/zend_accelerator_module.c @@ -73,7 +73,7 @@ static ZEND_INI_MH(OnUpdateMemoryConsumption) return FAILURE; } if (UNEXPECTED(memsize > ZEND_LONG_MAX / (1024 * 1024))) { - *p = ZEND_LONG_MAX; + *p = ZEND_LONG_MAX & ~(1024 * 1024 - 1); } else { *p = memsize * (1024 * 1024); }