From 8946b7b141ea72aa72d1330c27fa76c9f0af9b03 Mon Sep 17 00:00:00 2001 From: KoudelkaB <33930155+KoudelkaB@users.noreply.github.com> Date: Wed, 24 May 2023 17:23:27 +0200 Subject: [PATCH] Access violation when ALLOC_FALLBACK fixed Close GH-11312 --- NEWS | 1 + ext/opcache/zend_shared_alloc.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/NEWS b/NEWS index 332bd89835b..35e9fb124cf 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ PHP NEWS - Opcache: . Fix allocation loop in zend_shared_alloc_startup(). (nielsdos) + . Access violation on smm_shared_globals with ALLOC_FALLBACK. (KoudelkaB) - Standard: . Fix access on NULL pointer in array_merge_recursive(). (ilutov) diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index be931f526c1..afe539bf987 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -191,6 +191,7 @@ int zend_shared_alloc_startup(size_t requested_size, size_t reserved_size) } #if ENABLE_FILE_CACHE_FALLBACK if (ALLOC_FALLBACK == res) { + smm_shared_globals = NULL; return ALLOC_FALLBACK; } #endif @@ -216,6 +217,7 @@ int zend_shared_alloc_startup(size_t requested_size, size_t reserved_size) } #if ENABLE_FILE_CACHE_FALLBACK if (ALLOC_FALLBACK == res) { + smm_shared_globals = NULL; return ALLOC_FALLBACK; } #endif