dovecot-2.0: zlib: eof_offset wasn't always set right, causing a...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 1 19:46:08 EEST 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/e7768ec9d3de
changeset: 12224:e7768ec9d3de
user: Timo Sirainen <tss at iki.fi>
date: Fri Oct 01 17:46:03 2010 +0100
description:
zlib: eof_offset wasn't always set right, causing assert-crashes.
diffstat:
src/plugins/zlib/istream-bzlib.c | 3 ++-
src/plugins/zlib/istream-zlib.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 138d848b1e22 -r e7768ec9d3de src/plugins/zlib/istream-bzlib.c
--- a/src/plugins/zlib/istream-bzlib.c Fri Oct 01 17:35:01 2010 +0100
+++ b/src/plugins/zlib/istream-bzlib.c Fri Oct 01 17:46:03 2010 +0100
@@ -152,7 +152,8 @@
i_fatal_status(FATAL_OUTOFMEM, "bzlib.read(%s): Out of memory",
i_stream_get_name(&stream->istream));
case BZ_STREAM_END:
- zstream->eof_offset = stream->istream.v_offset + stream->pos;
+ zstream->eof_offset = stream->istream.v_offset +
+ (stream->pos - stream->skip);
if (size == 0) {
stream->istream.eof = TRUE;
return -1;
diff -r 138d848b1e22 -r e7768ec9d3de src/plugins/zlib/istream-zlib.c
--- a/src/plugins/zlib/istream-zlib.c Fri Oct 01 17:35:01 2010 +0100
+++ b/src/plugins/zlib/istream-zlib.c Fri Oct 01 17:46:03 2010 +0100
@@ -287,7 +287,8 @@
i_fatal_status(FATAL_OUTOFMEM, "zlib.read(%s): Out of memory",
i_stream_get_name(&stream->istream));
case Z_STREAM_END:
- zstream->eof_offset = stream->istream.v_offset + stream->pos;
+ zstream->eof_offset = stream->istream.v_offset +
+ (stream->pos - stream->skip);
i_stream_skip(stream->parent,
zstream->prev_size - zstream->zs.avail_in);
zstream->zs.avail_in = 0;
More information about the dovecot-cvs
mailing list