talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 5a965d62ae17f0480372cf187e79faaebed01894
parent 57e1eb91e6fa50ecac5309d5123b60b9a37ae5cb
Author: Ricardo Mones <ricardo@mones.org>
Date:   Wed, 25 Jul 2018 19:34:03 +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

Diffstat:
Msrc/plugins/mailmbox/mailmbox.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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;