1
0
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:
Antony Dovgal
2004-12-09 14:14:21 +00:00
parent 1266735cd0
commit e76824c91f
+13 -3
View File
@@ -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();
}
}
}
/* }}} */