]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: smtp-address - Don't recognize an address with empty localpart as <>.
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 20 Mar 2020 12:35:19 +0000 (13:35 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 20 May 2020 07:54:00 +0000 (07:54 +0000)
Depending on context, the addresses <""@domain.tld> and <""> are potentially
valid non-null addresses.

src/lib-smtp/smtp-address.h

index 64b6a009f4832aee9e0d1396baf46032df447458..326a6738f2bf3822fd59c185d6035c4aa7c4f89e 100644 (file)
@@ -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'));
 }