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

cras at dovecot.org cras at dovecot.org
Fri Oct 28 14:49:36 EEST 2005


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

Modified Files:
	istream-raw-mbox.c 
Log Message:
Don't crash with empty mboxes



Index: istream-raw-mbox.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/istream-raw-mbox.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- istream-raw-mbox.c	27 Oct 2005 12:34:32 -0000	1.35
+++ istream-raw-mbox.c	28 Oct 2005 11:49:34 -0000	1.36
@@ -161,7 +161,7 @@
 				stream->buffer = buf;
 				return -2;
 			}
-		} else if (stream->istream.v_offset != 0) {
+		} else if (stream->istream.v_offset != 0 || pos == 0) {
 			/* we've read the whole file, final byte should be
 			   the \n trailer */
 			if (pos > 0 && buf[pos-1] == '\n') {



More information about the dovecot-cvs mailing list