Skip to content

Commit

Permalink
ostream-zlib: Ignore missing finish if parent stream is ignoring errors
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
sirainen committed Jan 6, 2018
1 parent 7f0dcac commit 23da0fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-compression/ostream-zlib.c
Expand Up @@ -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);
Expand Down

0 comments on commit 23da0fa

Please sign in to comment.