[Commits] [SCM] claws branch, master, updated. 3.16.0-248-ge025cbc

mones at claws-mail.org mones at claws-mail.org
Wed Jul 25 19:37:49 CEST 2018


The branch, master has been updated
       via  e025cbc3bde755867af6011a6558126a4fb183e0 (commit)
      from  4fe990adffb69da201234e96134b432d00f6e9cb (commit)

Summary of changes:
 src/plugins/mailmbox/mailmbox.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit e025cbc3bde755867af6011a6558126a4fb183e0
Author: Ricardo Mones <ricardo at mones.org>
Date:   Wed Jul 25 19:34:03 2018 +0200

    Mailmbox: fix buffer size
    
    Should fix the following warnings reported on ML¹:
    
    mailmbox.c: In function ‘claws_mailmbox_expunge_no_lock.part.4’:
    mailmbox.c:1260:34: warning: ‘XXXXXX’ directive output may be truncated
    writing 6 bytes into a region of size between 1 and 4096
    [-Wformat-truncation=]
       snprintf(tmpfile, PATH_MAX, "%sXXXXXX", folder->mb_filename);
                                      ^~~~~~
    mailmbox.c:1260:3: note: ‘snprintf’ output between 7 and 4102 bytes into
    a destination of size 4096
       snprintf(tmpfile, PATH_MAX, "%sXXXXXX", folder->mb_filename);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    ¹ https://lists.claws-mail.org/pipermail/users/2018-July/022270.html

diff --git a/src/plugins/mailmbox/mailmbox.c b/src/plugins/mailmbox/mailmbox.c
index 3df5342..feb2453 100644
--- a/src/plugins/mailmbox/mailmbox.c
+++ b/src/plugins/mailmbox/mailmbox.c
@@ -1242,7 +1242,7 @@ static int claws_mailmbox_expunge_to_file_no_lock(char * dest_filename, int dest
 
 int claws_mailmbox_expunge_no_lock(struct claws_mailmbox_folder * folder)
 {
-  char tmpfile[PATH_MAX];
+  char tmpfile[PATH_MAX + 8]; /* for the extra Xs */
   int r;
   int res;
   int dest_fd;

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list