From: Stephan Bosch Date: Fri, 20 Mar 2020 12:37:04 +0000 (+0100) Subject: lib-smtp: smtp-address - Only produce a <> address in smtp_address_clone() when that... X-Git-Tag: 2.3.11.2~74 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b4a304dd7c142ddc8147565b916fc46a3af11a9;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-address - Only produce a <> address in smtp_address_clone() when that is the input. It also produced an effective null address when the localpart was empty. --- diff --git a/src/lib-smtp/smtp-address.c b/src/lib-smtp/smtp-address.c index dd045fb662..1997535d51 100644 --- a/src/lib-smtp/smtp-address.c +++ b/src/lib-smtp/smtp-address.c @@ -795,7 +795,7 @@ smtp_address_clone(pool_t pool, const struct smtp_address *src) /* @UNSAFE */ size = sizeof(struct smtp_address); - if (src->localpart != NULL && *src->localpart != '\0') { + if (!smtp_address_isnull(src)) { lpsize = strlen(src->localpart) + 1; size = MALLOC_ADD(size, lpsize); }