|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76618 segfault on imap_reopen
Submitted: 2018-07-13 07:54 UTC Modified: 2020-10-22 16:09 UTC
Avg. Score:3.3 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: slim at inbox dot lv Assigned: girgias (profile)
Status: Closed Package: IMAP related
PHP Version: 7.1.19 OS: linux
Private report: No CVE-ID: None
 [2018-07-13 07:54 UTC] slim at inbox dot lv
php segfaults randomly on heavy imap_reopen usage with 7.x branches.
From phpng-upgrading docs it looks like on failed mail_open() streamind should be closed, not deleted


php-inbox-php71-reopen-close.patch (last revision 2018-07-13 07:54 UTC by slim at inbox dot lv)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-07-13 11:37 UTC]
-Status: Open +Status: Verified
 [2018-07-13 11:37 UTC]
Simple reproducer without mailserver:

$imap = imap_open('~/good-mailbox', '', '', 0);
$foo = $imap;
var_dump(imap_reopen($imap, '~/bad-mailbox'));
 [2018-07-16 12:55 UTC]
-Status: Verified +Status: Assigned -Assigned To: +Assigned To: nikic
 [2018-07-16 12:55 UTC]
Nikita, is this the correct fix (being our presidental php-ng expert)?
 [2018-07-16 14:15 UTC]
It seems to me the correct fix would be to remove imap_reopen().
Consider how `bool freopen($res)` would work.
 [2018-07-16 20:30 UTC]
-Status: Assigned +Status: Analyzed -Assigned To: nikic +Assigned To:
 [2018-07-16 20:30 UTC]
@kalle: Patch looks good to me.
 [2020-10-22 16:09 UTC]
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: girgias
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 04:01:38 2024 UTC