]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
ostream-zlib: Ignore missing finish if parent stream is ignoring errors
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sat, 6 Jan 2018 19:22:11 +0000 (21:22 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 12 Mar 2018 08:10:01 +0000 (10:10 +0200)
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

index 848ecb7b89d2029055778cc521a083c1d417cfe4..e0b9a91416b35288d9b22d362d4da5729bf62404 100644 (file)
@@ -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);