]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-address - Only produce a <> address in smtp_address_clone() when that...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 20 Mar 2020 12:37:04 +0000 (13:37 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 20 May 2020 07:54:00 +0000 (07:54 +0000)
It also produced an effective null address when the localpart was empty.

src/lib-smtp/smtp-address.c

index dd045fb662e134a7a86d483c06f234b9723e8adc..1997535d517c6de6928e014fe26f63731c106158 100644 (file)
@@ -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);
        }