[dovecot-cvs] dovecot/src/lib-mail istream-header-filter.c, 1.33.2.1, 1.33.2.2

tss at dovecot.org tss at dovecot.org
Tue Feb 6 10:43:31 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv19734

Modified Files:
      Tag: branch_1_0
	istream-header-filter.c 
Log Message:
_read() could have returned "need more data" in wrong situations, which
could have caused problems later.



Index: istream-header-filter.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/istream-header-filter.c,v
retrieving revision 1.33.2.1
retrieving revision 1.33.2.2
diff -u -d -r1.33.2.1 -r1.33.2.2
--- istream-header-filter.c	8 Jun 2006 19:26:22 -0000	1.33.2.1
+++ istream-header-filter.c	6 Feb 2007 10:43:29 -0000	1.33.2.2
@@ -214,6 +214,9 @@
 		      mstream->header_size.virtual_size +
 		      mstream->header_size.physical_size);
 
+	stream->pos -= stream->skip;
+	stream->skip = 0;
+
 	stream->buffer = i_stream_get_data(mstream->input, &pos);
 	if (pos <= stream->pos) {
 		if ((ret = i_stream_read(mstream->input)) == -2) {
@@ -226,9 +229,6 @@
 		ret = 0;
 	}
 
-	stream->pos -= stream->skip;
-	stream->skip = 0;
-
 	ret = pos > stream->pos ? (ssize_t)(pos - stream->pos) :
 		(ret == 0 ? 0 : -1);
 	stream->pos = pos;



More information about the dovecot-cvs mailing list