From 894a5c4d650ea12b722677504ba75da8123b022b Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 23 Dec 2025 12:46:06 -0500 Subject: [PATCH] ext/session/mod_mm.c: add a few missing ZSTR macros In eaee504c the session's save_path global was changed to a zend_string pointer, but there are a few direct char-pointer accesses in ext/session/mod_mm.c that slipped through the cracks. GCC-15 notices them and fails to build due to the incompatible pointer types. Three ZSTR_* wrappers are all that is needed. Gentoo-Bug: https://bugs.gentoo.org/967862 --- ext/session/mod_mm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/session/mod_mm.c b/ext/session/mod_mm.c index b997a2bdcff54..b794be646961a 100644 --- a/ext/session/mod_mm.c +++ b/ext/session/mod_mm.c @@ -264,7 +264,7 @@ static void ps_mm_destroy(ps_mm *data) PHP_MINIT_FUNCTION(ps_mm) { - size_t save_path_len = strlen(PS(save_path)); + size_t save_path_len = ZSTR_LEN(PS(save_path)); size_t mod_name_len = strlen(sapi_module.name); size_t euid_len; char *ps_mm_path, euid[30]; @@ -284,8 +284,8 @@ PHP_MINIT_FUNCTION(ps_mm) /* Directory + '/' + File + Module Name + Effective UID + \0 */ ps_mm_path = emalloc(save_path_len + 1 + (sizeof(PS_MM_FILE) - 1) + mod_name_len + euid_len + 1); - memcpy(ps_mm_path, PS(save_path), save_path_len); - if (save_path_len && PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) { + memcpy(ps_mm_path, ZSTR_VAL(PS(save_path)), save_path_len); + if (save_path_len && ZSTR_VAL(PS(save_path))[save_path_len - 1] != DEFAULT_SLASH) { ps_mm_path[save_path_len] = DEFAULT_SLASH; save_path_len++; }