]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mailbox_attribute_get*() - Fail early on with empty key lookup
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 26 Oct 2022 23:56:45 +0000 (02:56 +0300)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Fri, 28 Oct 2022 06:45:16 +0000 (08:45 +0200)
This fixes using mail_attribute_dict with dict-sql.

src/lib-storage/mailbox-attribute.c

index 5bd8c1c0f7d9f575f9926a5682e3142560faf7cd..f27df7fa8654b1f862453670a924a8d520a25867 100644 (file)
@@ -364,6 +364,11 @@ mailbox_attribute_get_common(struct mailbox *box,
        const struct mailbox_attribute_internal *iattr;
        int ret;
 
+       if (key[0] == '\0') {
+               /* never exists, and may cause dict lookup errors */
+               return 0;
+       }
+
        iattr = mailbox_internal_attribute_get(type_flags, key);
 
        /* allow internal server attributes only for the inbox */