29 lines
1.2 KiB
Diff
29 lines
1.2 KiB
Diff
|
From 23da0fa1b30cc11bcc1d467674a0950c527e9ff1 Mon Sep 17 00:00:00 2001
|
||
|
From: Timo Sirainen <timo.sirainen@dovecot.fi>
|
||
|
Date: Sat, 6 Jan 2018 21:22:11 +0200
|
||
|
Subject: [PATCH] ostream-zlib: Ignore missing finish if parent stream is
|
||
|
ignoring errors
|
||
|
|
||
|
This fixes panic with imap_zlib plugin when client enables the IMAP COMPRESS
|
||
|
extension and disconnects:
|
||
|
|
||
|
Panic: file ostream-zlib.c: line 36 (o_stream_zlib_close): assertion failed: (zstream->ostream.finished || zstream->ostream.ostream.stream_errno != 0)
|
||
|
---
|
||
|
src/lib-compression/ostream-zlib.c | 3 ++-
|
||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/src/lib-compression/ostream-zlib.c b/src/lib-compression/ostream-zlib.c
|
||
|
index 848ecb7b89..e0b9a91416 100644
|
||
|
--- a/src/lib-compression/ostream-zlib.c
|
||
|
+++ b/src/lib-compression/ostream-zlib.c
|
||
|
@@ -33,7 +33,8 @@ static void o_stream_zlib_close(struct iostream_private *stream,
|
||
|
struct zlib_ostream *zstream = (struct zlib_ostream *)stream;
|
||
|
|
||
|
i_assert(zstream->ostream.finished ||
|
||
|
- zstream->ostream.ostream.stream_errno != 0);
|
||
|
+ zstream->ostream.ostream.stream_errno != 0 ||
|
||
|
+ zstream->ostream.error_handling_disabled);
|
||
|
(void)deflateEnd(&zstream->zs);
|
||
|
if (close_parent)
|
||
|
o_stream_close(zstream->ostream.parent);
|