php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33562 date("") crash php
Submitted: 2005-07-04 06:53 UTC Modified: 2005-07-04 09:48 UTC
From: xuefer at 21cn dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5CVS-2005-07-04 OS: *
Private report: No CVE-ID: None
 [2005-07-04 06:53 UTC] xuefer at 21cn dot com
Description:
------------
Breakpoint 1, php_format_date (format=0x1015d770 "", format_len=0, 
    t=0x1015ce28, localtime=1) at /home/Xuefer/src/php5/ext/date/php_date.c:317
317     return string.c;
(gdb) p string.c
$2 = 0x0
(gdb) l
310 
311     smart_str_0(&string);
312 
313     if (localtime) {
314         timelib_time_offset_dtor(offset);
315     }
316 
317     return string.c;
318 }
(gdb) c
#0  0x610e9731 in strlen () from /usr/bin/cygwin1.dll
#1  0x004256f5 in php_date (ht=1, return_value=0x1015be68, 
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, localtime=1)
    at /home/Xuefer/src/php5/ext/date/php_date.c:344
crash at:
(gdb) fr 1
#1  0x004256f5 in php_date (ht=1, return_value=0x1015be68, 
    return_value_ptr=0x0, this_ptr=0x0, return_value_used=1, localtime=1)
    at /home/Xuefer/src/php5/ext/date/php_date.c:344
344     RETVAL_STRING(string, 0);

Reproduce code:
---------------
php -r 'date("");'
or
<?php
echo date("");
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-07-04 09:48 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 11:01:28 2024 UTC