]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mail_user_get_alt_usernames() - Skip empty string values
authorMarco Bettini <marco.bettini@open-xchange.com>
Fri, 27 Jan 2023 14:03:22 +0000 (14:03 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Thu, 2 Feb 2023 14:13:03 +0000 (14:13 +0000)
src/lib-storage/mail-user.c

index 06944a2156d75856eaa0d6e6423d04c92b807bf3..e61a66b66896f21481786c4cfb563b8e7438d407 100644 (file)
@@ -693,7 +693,7 @@ const char *const *mail_user_get_alt_usernames(struct mail_user *user)
        for (unsigned int i = 0; user->userdb_fields[i] != NULL; i++) {
                const char *key, *value;
                if (t_split_key_value_eq(user->userdb_fields[i], &key, &value) &&
-                   str_begins_with(key, "user_")) {
+                   *value != '\0' && str_begins_with(key, "user_")) {
                        array_append(&alt_usernames, &key, 1);
                        array_append(&alt_usernames, &value, 1);
                }