From: Stanislav Malyshev Date: Fri, 4 Dec 2009 01:21:32 +0000 (+0000) Subject: protect http_session_vars from interrupt corruption X-Git-Tag: php-5.2.12RC4~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86529ad73c3fee55437ce04852ad30c9a7d31eb3;p=php protect http_session_vars from interrupt corruption improve save_path check --- diff --git a/ext/session/session.c b/ext/session/session.c index 9ca5a6450d..db397dd6ac 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -1817,7 +1817,10 @@ static PHP_FUNCTION(session_unset) } IF_SESSION_VARS() { - HashTable *ht = Z_ARRVAL_P(PS(http_session_vars)); + HashTable *ht; + + SEPARATE_ZVAL_IF_NOT_REF(&PS(http_session_vars)); + ht = Z_ARRVAL_P(PS(http_session_vars)); if (PG(register_globals)) { uint str_len; @@ -1899,7 +1902,10 @@ static PHP_FUNCTION(session_unregister) } convert_to_string_ex(p_name); - PS_DEL_VARL(Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name)); + IF_SESSION_VARS() { + SEPARATE_ZVAL_IF_NOT_REF(&PS(http_session_vars)); + PS_DEL_VARL(Z_STRVAL_PP(p_name), Z_STRLEN_PP(p_name)); + } RETURN_TRUE; }