php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45313 imap_header() is crashing with Segmentation fault
Submitted: 2008-06-19 09:46 UTC Modified: 2008-06-27 01:00 UTC
From: toto at lativio dot com Assigned:
Status: No Feedback Package: IMAP related
PHP Version: 5.2CVS-2008-06-19 (snap) OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-06-19 09:46 UTC] toto at lativio dot com
Description:
------------
When I'm using the imap_header() function to parse an email account emails very often the script is crashing with "Segmentation fault".
I saw this in the PHP bugs, but they all was old and for the oldest PHP versions. Now I have this bug again.

Reproduce code:
---------------
$mailbox=imap_open("{mail.myhost.com:110/pop3}INBOX","support","****");
$check = imap_check($mailbox);
$messages=$check->Nmsgs;
for($i=1;$i<=$messages;$i++)
{
    $header = imap_headerinfo($mailbox,$i);
    print_r($header);
    echo date("Y-m-d",$header->udate)."\n";
}

Expected result:
----------------
I expect to see the dates of the all emails.

Actual result:
--------------
When I execute the code it began to parse the emails. After few emails the script hangs for round a minute (or less) and then I receive the last print_r() results and then Segmentation fault.
The above URL is what the print_r() returns.
http://www.toshko-bg.com/toto/bad_email.html

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-19 10:25 UTC] pajoye@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

Would be nice to have a backtrace and the mails data if possible.
 [2008-06-27 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".
 [2014-06-13 08:12 UTC] salathe@php.net
Automatic comment from SVN on behalf of salathe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=333769
Log: Use object in OO example

--
Patch by anonymous #45313
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 21 15:01:23 2020 UTC