Bug #76618 [Ana->Csd]: segfault on imap_reopen

From: Date: Thu, 22 Oct 2020 16:09:02 +0000
Subject: Bug #76618 [Ana->Csd]: segfault on imap_reopen
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-229857@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76618&edit=1 ID: 76618 Updated by: girgias@php.net Reported by: slim at inbox dot lv Summary: segfault on imap_reopen -Status: Analyzed +Status: Closed Type: Bug Package: IMAP related Operating System: linux PHP Version: 7.1.19 -Assigned To: +Assigned To: girgias Block user comment: N Private report: N New Comment: Applied as https://github.com/php/php-src/commit/12a09183b369779fcf123cdd4fbacee373cc7d98 Previous Comments: ------------------------------------------------------------------------ [2018-07-16 20:30:11] nikic@php.net @kalle: Patch looks good to me. ------------------------------------------------------------------------ [2018-07-16 14:15:07] cmb@php.net It seems to me the correct fix would be to remove imap_reopen(). Consider how bool freopen($res) would work. ------------------------------------------------------------------------ [2018-07-16 12:55:46] kalle@php.net Nikita, is this the correct fix (being our presidental php-ng expert)? ------------------------------------------------------------------------ [2018-07-13 11:37:09] cmb@php.net Simple reproducer without mailserver: <?php $imap = imap_open('~/good-mailbox', '', '', 0); var_dump($imap); $foo = $imap; var_dump(imap_num_msg($imap)); var_dump(imap_reopen($imap, '~/bad-mailbox')); var_dump(imap_num_msg($imap)); ------------------------------------------------------------------------ [2018-07-13 07:54:03] slim at inbox dot lv Description: ------------ 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76618&edit=1

« previous php.bugs (#229857) next »