mirror of
https://github.com/php/php-src.git
synced 2026-04-26 17:38:14 +02:00
- Fixed bug #25780 (ext/session: invalid session.cookie_lifetime causes crash in win32).
This commit is contained in:
@@ -957,13 +957,17 @@ static void php_session_send_cookie(TSRMLS_D)
|
||||
|
||||
if (PS(cookie_lifetime) > 0) {
|
||||
struct timeval tv;
|
||||
time_t t;
|
||||
|
||||
gettimeofday(&tv, NULL);
|
||||
date_fmt = php_std_date(tv.tv_sec + PS(cookie_lifetime) TSRMLS_CC);
|
||||
t = tv.tv_sec + PS(cookie_lifetime);
|
||||
|
||||
smart_str_appends(&ncookie, COOKIE_EXPIRES);
|
||||
smart_str_appends(&ncookie, date_fmt);
|
||||
efree(date_fmt);
|
||||
if (t > 0) {
|
||||
date_fmt = php_std_date(t TSRMLS_CC);
|
||||
smart_str_appends(&ncookie, COOKIE_EXPIRES);
|
||||
smart_str_appends(&ncookie, date_fmt);
|
||||
efree(date_fmt);
|
||||
}
|
||||
}
|
||||
|
||||
if (PS(cookie_path)[0]) {
|
||||
|
||||
Reference in New Issue
Block a user