From: Timo Sirainen Date: Sat, 6 Jan 2018 19:22:11 +0000 (+0200) Subject: ostream-zlib: Ignore missing finish if parent stream is ignoring errors X-Git-Tag: 2.3.1~141 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9846c932cf13c40df1590100e70ce83627c1d36;p=thirdparty%2Fdovecot%2Fcore.git 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) --- 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);