Skip to content

Commit e30682a

Browse files
committed
ext/session/mod_mm.c: add a few missing ZSTR macros
In eaee504 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
1 parent f80338c commit e30682a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/session/mod_mm.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static void ps_mm_destroy(ps_mm *data)
264264

265265
PHP_MINIT_FUNCTION(ps_mm)
266266
{
267-
size_t save_path_len = strlen(PS(save_path));
267+
size_t save_path_len = ZSTR_LEN(PS(save_path));
268268
size_t mod_name_len = strlen(sapi_module.name);
269269
size_t euid_len;
270270
char *ps_mm_path, euid[30];
@@ -284,8 +284,8 @@ PHP_MINIT_FUNCTION(ps_mm)
284284
/* Directory + '/' + File + Module Name + Effective UID + \0 */
285285
ps_mm_path = emalloc(save_path_len + 1 + (sizeof(PS_MM_FILE) - 1) + mod_name_len + euid_len + 1);
286286

287-
memcpy(ps_mm_path, PS(save_path), save_path_len);
288-
if (save_path_len && PS(save_path)[save_path_len - 1] != DEFAULT_SLASH) {
287+
memcpy(ps_mm_path, ZSTR_VAL(PS(save_path)), save_path_len);
288+
if (save_path_len && ZSTR_VAL(PS(save_path))[save_path_len - 1] != DEFAULT_SLASH) {
289289
ps_mm_path[save_path_len] = DEFAULT_SLASH;
290290
save_path_len++;
291291
}

0 commit comments

Comments
 (0)