From: Timo Sirainen Date: Mon, 6 Sep 2010 17:17:17 +0000 (+0100) Subject: zlib: Potential assert-crashfix. X-Git-Tag: 2.0.2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2f76dfe4d23ef4cf8d379941af31c657ea2d93b;p=thirdparty%2Fdovecot%2Fcore.git zlib: Potential assert-crashfix. --- diff --git a/src/plugins/zlib/istream-bzlib.c b/src/plugins/zlib/istream-bzlib.c index 946c22e99c..d627c57429 100644 --- a/src/plugins/zlib/istream-bzlib.c +++ b/src/plugins/zlib/istream-bzlib.c @@ -50,7 +50,8 @@ static ssize_t i_stream_bzlib_read(struct istream_private *stream) high_offset = stream->istream.v_offset + (stream->pos - stream->skip); if (zstream->eof_offset == high_offset) { - i_assert(zstream->high_pos == 0); + i_assert(zstream->high_pos == 0 || + zstream->high_pos == stream->pos); stream->istream.eof = TRUE; return -1; } diff --git a/src/plugins/zlib/istream-zlib.c b/src/plugins/zlib/istream-zlib.c index 026036fa35..79c6ac8e7b 100644 --- a/src/plugins/zlib/istream-zlib.c +++ b/src/plugins/zlib/istream-zlib.c @@ -170,7 +170,8 @@ static ssize_t i_stream_zlib_read(struct istream_private *stream) high_offset = stream->istream.v_offset + (stream->pos - stream->skip); if (zstream->eof_offset == high_offset) { - i_assert(zstream->high_pos == 0); + i_assert(zstream->high_pos == 0 || + zstream->high_pos == stream->pos); if (!zstream->trailer_read) { do { ret = i_stream_zlib_read_trailer(zstream);