sniper          Wed Oct  8 06:25:40 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src    NEWS 
    /php-src/ext/session        session.c 
  Log:
  - Fixed bug #25780 (MFH: ext/session: invalid session.cookie_lifetime causes crash 
in win32).
  
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.429 php-src/NEWS:1.1247.2.430
--- php-src/NEWS:1.1247.2.429   Tue Oct  7 21:17:11 2003
+++ php-src/NEWS        Wed Oct  8 06:25:38 2003
@@ -3,6 +3,8 @@
 ?? Oct 2003, Version 4.3.4RC2
 - Fixed multibyte regex engine to properly handle ".*" pattern under
   POSIX compatible mode. (K.Kosako <kosako at sofnec.co.jp>, Moriyoshi)
+- Fixed bug #25780 (ext/session: invalid "session.cookie_lifetime" makes 
+  session_start() to crash in win32). (Jani)
 - Fixed bug #25770 (Segfault with PHP and bison 1.875). ([EMAIL PROTECTED], Marcus)
 - Fixed bug #25764 (ldap_get_option() crashes with unbound ldap link). (Jani)
 - Fixed bug #25758 (var_export does not escape ' & \ inside array keys). (Ilia)
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.336.2.28 
php-src/ext/session/session.c:1.336.2.29
--- php-src/ext/session/session.c:1.336.2.28    Fri Aug 29 08:35:15 2003
+++ php-src/ext/session/session.c       Wed Oct  8 06:25:39 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: session.c,v 1.336.2.28 2003/08/29 12:35:15 sas Exp $ */
+/* $Id: session.c,v 1.336.2.29 2003/10/08 10:25:39 sniper Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -857,13 +857,17 @@
        
        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));
+               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);
+                       smart_str_appends(&ncookie, COOKIE_EXPIRES);
+                       smart_str_appends(&ncookie, date_fmt);
+                       efree(date_fmt);
+               }
        }
 
        if (PS(cookie_path)[0]) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to