]> granicus.if.org Git - php/commitdiff
Fix bug 76618
authorGeorge Peter Banyard <girgias@php.net>
Thu, 22 Oct 2020 16:01:48 +0000 (17:01 +0100)
committerGeorge Peter Banyard <girgias@php.net>
Thu, 22 Oct 2020 16:01:48 +0000 (17:01 +0100)
Apply patch which was attached to the bug in July 2018

NEWS
ext/imap/php_imap.c

diff --git a/NEWS b/NEWS
index 6af9c206761d306cc735dceb96eaa4b661003169..31427b1b2d407ed10082ed90c3ef8d577426ffb8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ PHP                                                                        NEWS
 
 - IMAP:
   . Fixed bug #64076 (imap_sort() does not return FALSE on failure). (cmb)
+  . Fixed bug #76618 (segfault on imap_reopen). (girgias)
   . Fixed bug #80239 (imap_rfc822_write_address() leaks memory). (cmb)
   . Fixed minor regression caused by fixing bug #80220. (cmb)
   . Fixed bug #80242 (imap_mail_compose() segfaults for multipart with rfc822).
index cf8ed7bcf253581de291e1d58e26296bfdb0bbd6..7725f36f0eb174e86157120ec85eebf6d4e1c739 100644 (file)
@@ -1315,7 +1315,7 @@ PHP_FUNCTION(imap_reopen)
 
        imap_le_struct->imap_stream = mail_open(imap_le_struct->imap_stream, ZSTR_VAL(mailbox), flags);
        if (imap_le_struct->imap_stream == NIL) {
-               zend_list_delete(Z_RES_P(streamind));
+               zend_list_close(Z_RES_P(streamind));
                php_error_docref(NULL, E_WARNING, "Couldn't re-open stream");
                RETURN_FALSE;
        }