[dovecot-cvs] dovecot/src/deliver mail-send.c,1.4,1.5

tss at dovecot.org tss at dovecot.org
Sun Nov 12 21:31:14 UTC 2006


Update of /var/lib/cvs/dovecot/src/deliver
In directory talvi:/tmp/cvs-serv28790

Modified Files:
	mail-send.c 
Log Message:
Handle fwrite() failure early.



Index: mail-send.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/deliver/mail-send.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- mail-send.c	2 Nov 2006 20:53:48 -0000	1.4
+++ mail-send.c	12 Nov 2006 21:31:11 -0000	1.5
@@ -110,7 +110,8 @@
 			NULL, NULL);
 
 	    while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
-		    fwrite(data, size, 1, f);
+		    if (fwrite(data, size, 1, f) == 0)
+			    break;
 		    i_stream_skip(input, size);
 	    }
 	    i_stream_unref(&input);
@@ -148,7 +149,8 @@
                                           sizeof(hide_headers[0]), NULL, NULL);
 
     while ((ret = i_stream_read_data(input, &data, &size, 0)) > 0) {
-	    fwrite(data, size, 1, f);
+	    if (fwrite(data, size, 1, f) == 0)
+		    break;
 	    i_stream_skip(input, size);
     }
 



More information about the dovecot-cvs mailing list