dovecot-2.0: zlib: Potential assert-crashfix.

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 6 20:17:20 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/0d5f21aeda68
changeset: 12080:0d5f21aeda68
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 06 18:17:17 2010 +0100
description:
zlib: Potential assert-crashfix.

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 b00d3a367d79 -r 0d5f21aeda68 src/plugins/zlib/istream-bzlib.c
--- a/src/plugins/zlib/istream-bzlib.c	Mon Sep 06 16:35:13 2010 +0100
+++ b/src/plugins/zlib/istream-bzlib.c	Mon Sep 06 18:17:17 2010 +0100
@@ -50,7 +50,8 @@
 
 	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 -r b00d3a367d79 -r 0d5f21aeda68 src/plugins/zlib/istream-zlib.c
--- a/src/plugins/zlib/istream-zlib.c	Mon Sep 06 16:35:13 2010 +0100
+++ b/src/plugins/zlib/istream-zlib.c	Mon Sep 06 18:17:17 2010 +0100
@@ -170,7 +170,8 @@
 
 	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);


More information about the dovecot-cvs mailing list