diff options
author | Jani Taskinen <jani@php.net> | 2009-08-03 13:02:53 +0000 |
---|---|---|
committer | Jani Taskinen <jani@php.net> | 2009-08-03 13:02:53 +0000 |
commit | 952a193f94458f9c57fe43bbf9eeaf5276190ba0 (patch) | |
tree | 6629526d5f93d4b4debf35475189fc215548d918 /ext/imap/php_imap.c | |
parent | e3d23b959fac37af9e46ae06d32b5dc375b20ed1 (diff) | |
download | php-git-952a193f94458f9c57fe43bbf9eeaf5276190ba0.tar.gz |
- Fixed bug #48400 (imap crashes when closing stream opened with OP_PROTOTYPE flag)
Diffstat (limited to 'ext/imap/php_imap.c')
-rw-r--r-- | ext/imap/php_imap.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 9e75da9d67..d9564f62d9 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -597,7 +597,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)); @@ -1154,6 +1157,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)) { |