]> granicus.if.org Git - php/commitdiff
- Fixed bug #48400 (imap crashes when closing stream opened with OP_PROTOTYPE flag)
authorJani Taskinen <jani@php.net>
Mon, 3 Aug 2009 13:02:53 +0000 (13:02 +0000)
committerJani Taskinen <jani@php.net>
Mon, 3 Aug 2009 13:02:53 +0000 (13:02 +0000)
NEWS
ext/imap/php_imap.c

diff --git a/NEWS b/NEWS
index 9c591dd165bb6c51099f83ca2c358f0cd705d006..7409690049fcf374abfbc55ae5b97bf10c80e2dd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,8 +4,6 @@ PHP                                                                        NEWS
 - Fixed regression in cURL extension that prevented flush of data to output
   defined as a file handle. (Ilia)
 
-- Fixed bug #46020 (with Sun Java System Web Server 7.0 on HPUX, #define HPUX).
-  (Uwe Schindler)
 - Fixed bug #49132 (posix_times returns false without error).
   (phpbugs at gunnu dot us)
 - Fixed bug #49125 (Error in dba_exists C code). (jdornan at stanford dot edu)
@@ -28,6 +26,8 @@ PHP                                                                        NEWS
 - Fixed bug #48801 (Problem with imagettfbbox). (Takeshi Abe)
 - Fixed bug #48788 (RecursiveDirectoryIterator doesn't descend into symlinked
   directories). (Ilia)
+- Fixed bug #48774 (SIGSEGVs when using curl_copy_handle()).
+  (Sriram Natarajan)
 - Fixed bug #48763 (ZipArchive produces corrupt archive). (dani dot church at 
   gmail dot com, Pierre)
 - Fixed bug #48762 (IPv6 address filter still rejects valid address). (Felipe)
@@ -57,25 +57,27 @@ PHP                                                                        NEWS
 - Fixed bug #48465 (sys_get_temp_dir() possibly inconsistent when using
   TMPDIR). (Ilia)
 - Fixed bug #48450 (Compile failure under IRIX 6.5.30 building gd.c). (Kalle)
+- Fixed bug #48400 (imap crashes when closing stream opened with
+  OP_PROTOTYPE flag). (Jani)
 - Fixed bug #48276 (date("Y") on big endian machines produces the
   wrong result). (Scott)
 - Fixed bug #48247 (Infinite loop and possible crash during startup with
   errors when errors are logged). (Jani)
 - Fixed bug #48116 (Fixed build with Openssl 1.0). (Pierre, 
   Al dot Smith at aeschi dot ch dot eu dot org)
+- Fixed bug #48182 (ssl handshake fails during asynchronous socket connection).
+  (Sriram Natarajan)
 - Fixed bug #48057 (Only the date fields of the first row are fetched,
   others are empty). (info at programmiernutte dot net)
 - Fixed bug #47481 (natcasesort() does not sort extended ASCII characters
   correctly). (Herman Radtke)
 - Fixed bug #47351 (Memory leak in DateTime). (Derick, Tobias John)
+- Fixed bug #46020 (with Sun Java System Web Server 7.0 on HPUX, #define HPUX).
+  (Uwe Schindler)
 - Fixed bug #45905 (imagefilledrectangle() clipping error).
   (markril at hotmail dot com, Pierre)
 - Fixed bug #45280 (Reflection of instantiated COM classes causes PHP to crash) 
   (Paul Richards, Kalle)
-- Fixed bug #48774 (SIGSEGVs when using curl_copy_handle()).
-  (Sriram Natarajan)
-- Fixed bug #48182 (ssl handshake fails during asynchronous socket connection).
-  (Sriram Natarajan)
 - Fixed bug #45141 (setcookie will output expires years of >4 digits). (Ilia)
 - Fixed bug #44144 (spl_autoload_functions() should return object instance
   when appropriate). (Hannes, Etienne)
index a5b2dc90686966a79706bc224f8bd46841164a83..e44e7078e0254d179352a99882f2d692fc4086b4 100644 (file)
@@ -221,7 +221,10 @@ static void mail_close_it(zend_rsrc_list_entry *rsrc TSRMLS_DC)
 {
        pils *imap_le_struct = (pils *)rsrc->ptr;
 
-       mail_close_full(imap_le_struct->imap_stream, imap_le_struct->flags);
+       /* Do not try to close prototype streams */
+       if (!(imap_le_struct->flags & OP_PROTOTYPE)) {
+               mail_close_full(imap_le_struct->imap_stream, imap_le_struct->flags);
+       }
 
        if (IMAPG(imap_user)) {
                efree(IMAPG(imap_user));
@@ -783,6 +786,9 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
                        cl_flags = CL_EXPUNGE;
                        flags ^= PHP_EXPUNGE;
                }
+               if (flags & OP_PROTOTYPE) {
+                       cl_flags |= OP_PROTOTYPE;
+               }
        }
 
        if (IMAPG(imap_user)) {