php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45208 getdate() causes a segfault
Submitted: 2008-06-08 12:49 UTC Modified: 2008-07-21 01:00 UTC
From: ncoesel at dealogic dot nl Assigned:
Status: No Feedback Package: Date/time related
PHP Version: 5.2.6 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-06-08 12:49 UTC] ncoesel at dealogic dot nl
Description:
------------
Calling getdate causes a segfault after upgrading from PHP Version 4.3.2 to PHP Version 5.2.6-1. 

Reproduce code:
---------------
<?php
$d=getdate();
print_r($d);
?>

Or

<?php
$curtime=time();
$d=getdate($curtime);
print_r($d);
?>


Expected result:
----------------
Array ( [seconds] => 18 [minutes] => 50 [hours] => 13 [mday] => 8 [wday] => 0 [mon] => 6 [year] => 2008 [yday] => 159 [weekday] => Sunday [month] => June [0] => 1212925818 ) 

Actual result:
--------------
Segfault message in Apache log

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-08 13:19 UTC] ncoesel at dealogic dot nl
Looking at the source of getdate() it strikes me several 'foreign' pointers are used before being checked. From this I suspect there is something wrong with the timezone settings on my machine.
 [2008-06-08 13:29 UTC] ncoesel at dealogic dot nl
Yes, installing the timezone data fixed the problem! This still leaves the pointer checking issue so the user simply gets no data or an error message :-)
 [2008-07-21 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC