tony2001                Thu Jun  7 09:07:12 2007 UTC

  Modified files:              
    /php-src/ext/pdo_sqlite/sqlite/src  date.c 
    /php-src/ext/calendar       easter.c 
    /php-src/ext/sqlite/libsqlite/src   date.c 
    /php-src/ext/standard       info.c 
    /php-src/ext/xmlrpc/libxmlrpc       xmlrpc.c 
  Log:
  php_localtime_r() checks
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/pdo_sqlite/sqlite/src/date.c?r1=1.8&r2=1.9&diff_format=u
Index: php-src/ext/pdo_sqlite/sqlite/src/date.c
diff -u php-src/ext/pdo_sqlite/sqlite/src/date.c:1.8 
php-src/ext/pdo_sqlite/sqlite/src/date.c:1.9
--- php-src/ext/pdo_sqlite/sqlite/src/date.c:1.8        Wed Dec  6 13:20:17 2006
+++ php-src/ext/pdo_sqlite/sqlite/src/date.c    Thu Jun  7 09:07:12 2007
@@ -415,8 +415,10 @@
   computeJD(&x);
   t = (x.rJD-2440587.5)*86400.0 + 0.5;
   sqlite3OsEnterMutex();
-  pTm = php_localtime_r
-(&t, &tmbuf);
+  pTm = php_localtime_r(&t, &tmbuf);
+  if (!pTm) {
+         return 0;
+  }
   y.Y = pTm->tm_year + 1900;
   y.M = pTm->tm_mon + 1;
   y.D = pTm->tm_mday;
http://cvs.php.net/viewvc.cgi/php-src/ext/calendar/easter.c?r1=1.20&r2=1.21&diff_format=u
Index: php-src/ext/calendar/easter.c
diff -u php-src/ext/calendar/easter.c:1.20 php-src/ext/calendar/easter.c:1.21
--- php-src/ext/calendar/easter.c:1.20  Mon Jan  1 09:29:21 2007
+++ php-src/ext/calendar/easter.c       Thu Jun  7 09:07:12 2007
@@ -36,10 +36,14 @@
        /* Default to the current year if year parameter is not given */
        {
                time_t a;
-               struct tm b;
+               struct tm b, *res;
                time(&a);
-               php_localtime_r(&a, &b);
-               year = 1900 + b.tm_year;
+               res = php_localtime_r(&a, &b);
+               if (!res) {
+                       year = 1900;
+               } else {
+                       year = 1900 + b.tm_year;
+               }
        }
 
        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/libsqlite/src/date.c?r1=1.6&r2=1.7&diff_format=u
Index: php-src/ext/sqlite/libsqlite/src/date.c
diff -u php-src/ext/sqlite/libsqlite/src/date.c:1.6 
php-src/ext/sqlite/libsqlite/src/date.c:1.7
--- php-src/ext/sqlite/libsqlite/src/date.c:1.6 Mon Jan  1 09:29:30 2007
+++ php-src/ext/sqlite/libsqlite/src/date.c     Thu Jun  7 09:07:12 2007
@@ -16,7 +16,7 @@
 ** sqliteRegisterDateTimeFunctions() found at the bottom of the file.
 ** All other code has file scope.
 **
-** $Id: date.c,v 1.6 2007/01/01 09:29:30 sebastian Exp $
+** $Id: date.c,v 1.7 2007/06/07 09:07:12 tony2001 Exp $
 **
 ** NOTES:
 **
@@ -418,6 +418,9 @@
   t = (x.rJD-2440587.5)*86400.0 + 0.5;
   sqliteOsEnterMutex();
   pTm = php_localtime_r(&t, &tmbuf);
+  if (!pTm) {
+         return 0;
+  }
   y.Y = pTm->tm_year + 1900;
   y.M = pTm->tm_mon + 1;
   y.D = pTm->tm_mday;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/info.c?r1=1.278&r2=1.279&diff_format=u
Index: php-src/ext/standard/info.c
diff -u php-src/ext/standard/info.c:1.278 php-src/ext/standard/info.c:1.279
--- php-src/ext/standard/info.c:1.278   Mon Apr  2 12:42:18 2007
+++ php-src/ext/standard/info.c Thu Jun  7 09:07:12 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: info.c,v 1.278 2007/04/02 12:42:18 sniper Exp $ */
+/* $Id: info.c,v 1.279 2007/06/07 09:07:12 tony2001 Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -1002,7 +1002,7 @@
        the_time = time(NULL);
        ta = php_localtime_r(&the_time, &tmbuf);
 
-       if ((ta->tm_mon==3) && (ta->tm_mday==1)) {
+       if (ta && (ta->tm_mon==3) && (ta->tm_mday==1)) {
                logo_guid = PHP_EGG_LOGO_GUID;
        } else {
                logo_guid = PHP_LOGO_GUID;
http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c?r1=1.10&r2=1.11&diff_format=u
Index: php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c
diff -u php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c:1.10 
php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c:1.11
--- php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c:1.10  Mon Jan  1 09:29:33 2007
+++ php-src/ext/xmlrpc/libxmlrpc/xmlrpc.c       Thu Jun  7 09:07:12 2007
@@ -31,7 +31,7 @@
 */
 
 
-static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.10 2007/01/01 09:29:33 
sebastian Exp $";
+static const char rcsid[] = "#(@) $Id: xmlrpc.c,v 1.11 2007/06/07 09:07:12 
tony2001 Exp $";
 
 
 /****h* ABOUT/xmlrpc
@@ -43,6 +43,9 @@
  *   9/1999 - 10/2000
  * HISTORY
  *   $Log: xmlrpc.c,v $
+ *   Revision 1.11  2007/06/07 09:07:12  tony2001
+ *   php_localtime_r() checks
+ *
  *   Revision 1.10  2007/01/01 09:29:33  sebastian
  *   Bump year.
  *
@@ -239,6 +242,9 @@
 static int date_to_ISO8601 (time_t value, char *buf, int length) {
    struct tm *tm, tmbuf;
    tm = php_localtime_r(&value, &tmbuf);
+   if (!tm) {
+          return 0;
+   }
 #if 0  /* TODO: soap seems to favor this method. xmlrpc the latter. */
        return strftime (buf, length, "%Y-%m-%dT%H:%M:%SZ", tm);
 #else

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

Reply via email to