|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-02 22:46 UTC] scottmac@php.net
[2009-09-10 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Dec 12 03:00:01 2025 UTC |
Description: ------------ If an IMAP server closes a connection without sending a BYE command, PHP segfaults on the next IMAP command run on the mailbox resource. I noticed this while testing against an exchange server, where I was selecting a folder that doesn't exist. After 10 times it disconnected me without sending a BYE command. When this happens PHP segfaulted, which doesn't allow for the script to do any error handling. Reproduce code: --------------- <?php //Try testing against an exchange server that disconnects after a //certain number of "bad" commands $flags = '/novalidate-cert'; $host = 'secure.emailsrvr.com:143'; $username = 'noteworthy2@sts.com'; $password = 'webmail'; $base_imap_string = '{' . $host . $flags . '}'; $connect_string = $base_imap_string . 'INBOX'; $mailbox = imap_open($connect_string, $username, $password, 0, 3); $connect_string = $base_imap_string . 'Does not exist'; for ($i = 0; $i < 10; $i++) { $reopen_success = imap_reopen($mailbox, $connect_string, 0, 3); } Expected result: ---------------- imap_reopen either returns false or throws a PHP error. Actual result: -------------- The script segfaults.