[dovecot-cvs] dovecot/src/lib-storage/index/mbox istream-raw-mbox.c, 1.43, 1.44

cras at dovecot.org cras at dovecot.org
Thu Aug 10 22:06:33 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv5020/lib-storage/index/mbox

Modified Files:
	istream-raw-mbox.c 
Log Message:
We got into infinite loops if trying to open a 2 byte sized file as mbox.



Index: istream-raw-mbox.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/istream-raw-mbox.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- istream-raw-mbox.c	7 Aug 2006 12:42:38 -0000	1.43
+++ istream-raw-mbox.c	10 Aug 2006 19:06:29 -0000	1.44
@@ -194,7 +194,7 @@
 
 	if (stream->istream.v_offset == rstream->from_offset) {
 		/* beginning of message, we haven't yet read our From-line */
-		if (pos == 2) {
+		if (pos == 2 && ret > 0) {
 			/* we're at the end of file with CR+LF linefeeds?
 			   need more data to verify it. */
 			rstream->input_peak_offset =



More information about the dovecot-cvs mailing list