1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4' into PHP-8.5

* PHP-8.4:
  Fix access to uninitialized variables in preload_load()
This commit is contained in:
Arnaud Le Blanc
2025-10-10 15:44:57 +02:00
2 changed files with 10 additions and 10 deletions

4
NEWS
View File

@@ -10,6 +10,10 @@ PHP NEWS
. Fixed bug GH-19817 (Decode SCRIPT_FILENAME issue in php 8.5).
(Jakub Zelenka)
- Opcache:
. Fixed bug GH-20081 (access to uninitialized vars in preload_load()).
(Arnaud)
- SPL:
. Fixed bug GH-20101 (SplHeap/SplPriorityQueue serialization
exposes INDIRECTs). (nielsdos)

View File

@@ -4522,16 +4522,6 @@ static void preload_load(size_t orig_map_ptr_static_last)
}
}
if (EG(zend_constants)) {
EG(persistent_constants_count) = EG(zend_constants)->nNumUsed;
}
if (EG(function_table)) {
EG(persistent_functions_count) = EG(function_table)->nNumUsed;
}
if (EG(class_table)) {
EG(persistent_classes_count) = EG(class_table)->nNumUsed;
}
size_t old_map_ptr_last = CG(map_ptr_last);
if (zend_map_ptr_static_last != ZCSG(map_ptr_static_last) || old_map_ptr_last != ZCSG(map_ptr_last)) {
CG(map_ptr_last) = ZCSG(map_ptr_last);
@@ -4801,6 +4791,12 @@ static zend_result accel_preload(const char *config, bool in_child)
preload_load(orig_map_ptr_static_last);
/* Update persistent counts, as shutdown will discard anything past
* that, and these tables are aliases to global ones at this point. */
EG(persistent_functions_count) = EG(function_table)->nNumUsed;
EG(persistent_classes_count) = EG(class_table)->nNumUsed;
EG(persistent_constants_count) = EG(zend_constants)->nNumUsed;
/* Store individual scripts with unlinked classes */
HANDLE_BLOCK_INTERRUPTIONS();
SHM_UNPROTECT();