Mailmbox: fix buffer overflow in mailimf_get_message_id().
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 24 Nov 2018 22:14:26 +0000 (23:14 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 24 Nov 2018 22:14:26 +0000 (23:14 +0100)
commit3a482f4d25110e588ef58d5ee67fa4216a6b631d
tree4a28c1e36b61f1616324f6f10cc0858295b0e9c2
parenta44ea1792e33e0554c721d50f3038c4e1e20ed81
Mailmbox: fix buffer overflow in mailimf_get_message_id().

The compiler warning was:

mailimf_types_helper.c: In function ‘mailimf_get_message_id’:
mailimf_types_helper.c:1270:51: warning: ‘%s’ directive output may be truncated writing up to 511 bytes into a region of size between 463 and 500 [-Wformat-truncation=]
   snprintf(id, MAX_MESSAGE_ID, "etPan.%llx.%lx.%x@%s",
                                                   ^~
     (long long)now, value, getpid(), name);
                                      ~~~~
mailimf_types_helper.c:1270:3: note: ‘snprintf’ output between 13 and 561 bytes into a destination of size 512
   snprintf(id, MAX_MESSAGE_ID, "etPan.%llx.%lx.%x@%s",
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     (long long)now, value, getpid(), name);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/plugins/mailmbox/mailimf_types_helper.c