From: Stephan Bosch Date: Fri, 20 Mar 2020 12:35:19 +0000 (+0100) Subject: lib-smtp: smtp-address - Don't recognize an address with empty localpart as <>. X-Git-Tag: 2.3.10.1~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=063462d588eaea6f266596fae5f5470792dcc98d;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: smtp-address - Don't recognize an address with empty localpart as <>. Depending on context, the addresses <""@domain.tld> and <""> are potentially valid non-null addresses. --- diff --git a/src/lib-smtp/smtp-address.h b/src/lib-smtp/smtp-address.h index 64b6a009f4..326a6738f2 100644 --- a/src/lib-smtp/smtp-address.h +++ b/src/lib-smtp/smtp-address.h @@ -200,15 +200,14 @@ smtp_address_equals_icase(const struct smtp_address *address1, static inline bool ATTR_NULL(1) ATTR_PURE smtp_address_isnull(const struct smtp_address *address) { - return (address == NULL || address->localpart == NULL || - *address->localpart == '\0'); + return (address == NULL || address->localpart == NULL); } static inline bool ATTR_NULL(1) ATTR_PURE smtp_address_is_broken(const struct smtp_address *address) { return (address != NULL && - (address->localpart == NULL || *address->localpart == '\0') && + smtp_address_isnull(address) && (address->raw != NULL && *address->raw != '\0')); }