[Commits] [SCM] claws branch, master, updated. 3.17.0-109-gcb3f6bf

Colin colin at claws-mail.org
Wed Oct 10 09:59:34 CEST 2018


The branch, master has been updated
       via  cb3f6bfba779f53100a9b21c09cb9489ad7469d0 (commit)
      from  1be4e8b27b6cd7977df039ff5e34fd80fceb580a (commit)

Summary of changes:
 src/procmime.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit cb3f6bfba779f53100a9b21c09cb9489ad7469d0
Author: Colin Leroy <colin at colino.net>
Date:   Wed Oct 10 09:59:10 2018 +0200

    Fix in-memory temporary file length

diff --git a/src/procmime.c b/src/procmime.c
index 8920c1f..8b42d20 100644
--- a/src/procmime.c
+++ b/src/procmime.c
@@ -428,8 +428,10 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
 					err = TRUE;
 			}
 		}
-		if (tmpfp != outfp)
+		if (tmpfp != outfp) {
+			ftruncate(fileno(tmpfp), ftell(tmpfp));
 			claws_fclose(tmpfp);
+		}
 	} else if (encoding == ENC_X_UUENCODE) {
 		gchar outbuf[BUFFSIZE];
 		gint len;
@@ -465,6 +467,7 @@ gboolean procmime_decode_content(MimeInfo *mimeinfo)
 			g_warning("write error");
 	}
 
+	ftruncate(fileno(outfp), ftell(outfp));
 	claws_fclose(outfp);
 	claws_fclose(infp);
 
@@ -838,6 +841,7 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo)
 
 	err = procmime_scan_text_content(mimeinfo, scan_fputs_cb, outfp);
 
+	ftruncate(fileno(outfp), ftell(outfp));
 	rewind(outfp);
 	if (err == TRUE) {
 		claws_fclose(outfp);
@@ -861,7 +865,7 @@ FILE *procmime_get_binary_content(MimeInfo *mimeinfo)
 	if (procmime_get_part_to_stream(outfp, mimeinfo) < 0) {
 		return NULL;
 	}
-
+	ftruncate(fileno(outfp), ftell(outfp));
 	return outfp;
 }
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list