]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: Fix crash using fts_autoexpunge_exclude = \Special-use crash
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 10 Feb 2017 10:50:58 +0000 (12:50 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 10 Feb 2017 11:34:54 +0000 (13:34 +0200)
It crashed whenever seeing a mailbox that didn't have any special-use flags.

src/plugins/fts/fts-storage.c

index 4d1687191af995ef43618fe2e0ef6d76da45aca2..1425941c1cf1b4a30676fd75690e0bd350337e2b 100644 (file)
@@ -781,7 +781,8 @@ static bool fts_autoindex_exclude_match(struct mailbox *box)
        for (i = 0; exclude_list[i] != NULL; i++) {
                if (exclude_list[i][0] == '\\') {
                        /* \Special-use flag */
-                       if (str_array_icase_find(special_use, exclude_list[i]))
+                       if (special_use != NULL &&
+                           str_array_icase_find(special_use, exclude_list[i]))
                                return TRUE;
                } else {
                        /* mailbox name with wildcards */