File 0015-lib-smtp-smtp-address-Only-produce-a-address-in-smtp.patch of Package dovecot23.16062

From cbab48f174580bfb8d49321d8d336f96a231b0cd Mon Sep 17 00:00:00 2001
From: Stephan Bosch <stephan.bosch@open-xchange.com>
Date: Fri, 20 Mar 2020 13:37:04 +0100
Subject: [PATCH 15/16] 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.
---
 src/lib-smtp/smtp-address.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
 	}
-- 
2.11.0

openSUSE Build Service is sponsored by