Mercurial > dovecot > core-2.2
changeset 22154:91278ef69de7
lib-mail: message_address_write: Fix generating group list with empty name
Empty name for group list must be quoted.
Test case:
{ { name = NULL, mailbox = "", domain = NULL }, { name = NULL, mailbox = NULL, domain = NULL } }
converts to:
"":;
author | Pali Rohár <pali.rohar@gmail.com> |
---|---|
date | Sun, 05 Jun 2016 15:48:15 +0200 |
parents | 528bd5a67923 |
children | fe6b566d6f1c |
files | src/lib-mail/message-address.c |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-mail/message-address.c Sun Jun 05 15:48:14 2016 +0200 +++ b/src/lib-mail/message-address.c Sun Jun 05 15:48:15 2016 +0200 @@ -358,8 +358,12 @@ if (!in_group) { /* beginning of group. mailbox is the group name, others are NULL. */ - if (addr->mailbox != NULL) + if (addr->mailbox != NULL && *addr->mailbox != '\0') { str_append(str, addr->mailbox); + } else { + /* empty group name needs to be quoted */ + str_append(str, "\"\""); + } str_append(str, ": "); first = TRUE; } else {