derick          Thu Dec 18 14:57:19 2008 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/ext/date   php_date.c 
    /php-src/ext/date/lib       parse_date.c parse_date.re timelib.h 
  Log:
  - MFH: Fixed bug #46889: Memory leak in strtotime().
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1363&r2=1.2027.2.547.2.1364&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1363 php-src/NEWS:1.2027.2.547.2.1364
--- php-src/NEWS:1.2027.2.547.2.1363    Thu Dec 18 14:29:38 2008
+++ php-src/NEWS        Thu Dec 18 14:56:45 2008
@@ -6,6 +6,7 @@
 - Fixed security issue in imagerotate(), background colour isn't validated
   correctly with a non truecolour image. (Fixes CVE-2008-5498) (Scott)
 
+- Fixed bug #46889: Memory leak in strtotime(). (Derick)
 - Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value
   inside a binary or image column type). (Ilia)
 - Fixed bug #46782 (fastcgi.c parse error). (Matt)
http://cvs.php.net/viewvc.cgi/php-src/ext/date/php_date.c?r1=1.43.2.45.2.62&r2=1.43.2.45.2.63&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.43.2.45.2.62 
php-src/ext/date/php_date.c:1.43.2.45.2.63
--- php-src/ext/date/php_date.c:1.43.2.45.2.62  Tue Dec  2 18:01:57 2008
+++ php-src/ext/date/php_date.c Thu Dec 18 14:56:46 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_date.c,v 1.43.2.45.2.62 2008/12/02 18:01:57 derick Exp $ */
+/* $Id: php_date.c,v 1.43.2.45.2.63 2008/12/18 14:56:46 derick Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1143,7 +1143,7 @@
        t = timelib_strtotime(times, time_len, &error, DATE_TIMEZONEDB);
        error1 = error->error_count;
        timelib_error_container_dtor(error);
-       timelib_fill_holes(t, now, 0);
+       timelib_fill_holes(t, now, TIMELIB_NO_CLONE);
        timelib_update_ts(t, tzi);
        ts = timelib_date_to_int(t, &error2);
 
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.c?r1=1.29.2.30.2.17&r2=1.29.2.30.2.18&diff_format=u
Index: php-src/ext/date/lib/parse_date.c
diff -u php-src/ext/date/lib/parse_date.c:1.29.2.30.2.17 
php-src/ext/date/lib/parse_date.c:1.29.2.30.2.18
--- php-src/ext/date/lib/parse_date.c:1.29.2.30.2.17    Sun Oct 26 11:27:07 2008
+++ php-src/ext/date/lib/parse_date.c   Thu Dec 18 14:56:46 2008
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Sun Oct 26 11:59:08 2008 */
+/* Generated by re2c 0.13.5 on Thu Dec 18 15:52:22 2008 */
 #line 1 "ext/date/lib/parse_date.re"
 /*
    +----------------------------------------------------------------------+
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: parse_date.c,v 1.29.2.30.2.17 2008/10/26 11:27:07 derick Exp $ */
+/* $Id: parse_date.c,v 1.29.2.30.2.18 2008/12/18 14:56:46 derick Exp $ */
 
 #include "timelib.h"
 
@@ -22483,7 +22483,7 @@
 
 void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
 {
-       if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && 
!parsed->have_time) {
+       if (!(options & TIMELIB_OVERRIDE_TIME) && parsed->have_date && 
!parsed->have_time) {
                parsed->h = 0;
                parsed->i = 0;
                parsed->s = 0;
@@ -22503,7 +22503,7 @@
                parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
        }
        if (!parsed->tz_info) {
-               parsed->tz_info = now->tz_info ? 
timelib_tzinfo_clone(now->tz_info) : NULL;
+               parsed->tz_info = now->tz_info ? (!(options & TIMELIB_NO_CLONE) 
? timelib_tzinfo_clone(now->tz_info) : now->tz_info) : NULL;
        }
        if (parsed->zone_type == 0 && now->zone_type != 0) {
                parsed->zone_type = now->zone_type;
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/parse_date.re?r1=1.26.2.27.2.14&r2=1.26.2.27.2.15&diff_format=u
Index: php-src/ext/date/lib/parse_date.re
diff -u php-src/ext/date/lib/parse_date.re:1.26.2.27.2.14 
php-src/ext/date/lib/parse_date.re:1.26.2.27.2.15
--- php-src/ext/date/lib/parse_date.re:1.26.2.27.2.14   Sun Oct 26 11:27:32 2008
+++ php-src/ext/date/lib/parse_date.re  Thu Dec 18 14:57:04 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: parse_date.re,v 1.26.2.27.2.14 2008/10/26 11:27:32 derick Exp $ */
+/* $Id: parse_date.re,v 1.26.2.27.2.15 2008/12/18 14:57:04 derick Exp $ */
 
 #include "timelib.h"
 
@@ -1619,7 +1619,7 @@
 
 void timelib_fill_holes(timelib_time *parsed, timelib_time *now, int options)
 {
-       if (!(options && TIMELIB_OVERRIDE_TIME) && parsed->have_date && 
!parsed->have_time) {
+       if (!(options & TIMELIB_OVERRIDE_TIME) && parsed->have_date && 
!parsed->have_time) {
                parsed->h = 0;
                parsed->i = 0;
                parsed->s = 0;
@@ -1639,7 +1639,7 @@
                parsed->tz_abbr = now->tz_abbr ? strdup(now->tz_abbr) : NULL;
        }
        if (!parsed->tz_info) {
-               parsed->tz_info = now->tz_info ? 
timelib_tzinfo_clone(now->tz_info) : NULL;
+               parsed->tz_info = now->tz_info ? (!(options & TIMELIB_NO_CLONE) 
? timelib_tzinfo_clone(now->tz_info) : now->tz_info) : NULL;
        }
        if (parsed->zone_type == 0 && now->zone_type != 0) {
                parsed->zone_type = now->zone_type;
http://cvs.php.net/viewvc.cgi/php-src/ext/date/lib/timelib.h?r1=1.10.2.11.2.5&r2=1.10.2.11.2.6&diff_format=u
Index: php-src/ext/date/lib/timelib.h
diff -u php-src/ext/date/lib/timelib.h:1.10.2.11.2.5 
php-src/ext/date/lib/timelib.h:1.10.2.11.2.6
--- php-src/ext/date/lib/timelib.h:1.10.2.11.2.5        Fri Feb 22 09:48:18 2008
+++ php-src/ext/date/lib/timelib.h      Thu Dec 18 14:57:04 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: timelib.h,v 1.10.2.11.2.5 2008/02/22 09:48:18 derick Exp $ */
+/* $Id: timelib.h,v 1.10.2.11.2.6 2008/12/18 14:57:04 derick Exp $ */
 
 #ifndef __TIMELIB_H__
 #define __TIMELIB_H__
@@ -28,6 +28,7 @@
 
 #define TIMELIB_NONE             0x00
 #define TIMELIB_OVERRIDE_TIME    0x01
+#define TIMELIB_NO_CLONE         0x02
 
 #define TIMELIB_SPECIAL_WEEKDAY  0x01
 



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

Reply via email to