[dovecot-cvs] dovecot/src/deliver mail-send.c,1.1.2.3,1.1.2.4

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


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

Modified Files:
      Tag: branch_1_0
	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.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- mail-send.c	2 Nov 2006 20:53:46 -0000	1.1.2.3
+++ mail-send.c	12 Nov 2006 21:31:09 -0000	1.1.2.4
@@ -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