mirror of
https://github.com/php/php-src.git
synced 2026-04-26 17:38:14 +02:00
fix segfault in session_module_name() when session.save_handler is empty
This commit is contained in:
+13
-3
@@ -1337,11 +1337,21 @@ PHP_FUNCTION(session_module_name)
|
||||
}
|
||||
PS(mod_data) = NULL;
|
||||
|
||||
RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
|
||||
|
||||
if (PS(mod) && PS(mod)->s_name) {
|
||||
RETVAL_STRING(safe_estrdup(PS(mod)->s_name), 0);
|
||||
}
|
||||
else {
|
||||
RETVAL_EMPTY_STRING();
|
||||
}
|
||||
|
||||
zend_alter_ini_entry("session.save_handler", sizeof("session.save_handler"), Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name), PHP_INI_USER, PHP_INI_STAGE_RUNTIME);
|
||||
} else {
|
||||
RETURN_STRING(safe_estrdup(PS(mod)->s_name), 0);
|
||||
if (PS(mod) && PS(mod)->s_name) {
|
||||
RETURN_STRING(safe_estrdup(PS(mod)->s_name), 0);
|
||||
}
|
||||
else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
Reference in New Issue
Block a user