]> 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:05:29 +0000 (17:05 +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 ca31fe91d4dcf33a28df040b5554df6d0a331d8f..c185d60a9bbcff05d36c6c96d658917fed303f9e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ PHP                                                                        NEWS
     fulfilled by traits). (Nikita)
 
 - IMAP:
+  . 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 6861b2ad9eca57e3055c03fe9d5db9ddeb201bca..147df9d4faacfb49f843781a9626be4b8984678e 100644 (file)
@@ -867,7 +867,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;
        }