]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Don't crash if acl_dict setting is missing.
authorTimo Sirainen <tss@iki.fi>
Wed, 19 Nov 2008 14:41:47 +0000 (16:41 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 19 Nov 2008 14:41:47 +0000 (16:41 +0200)
--HG--
branch : HEAD

src/plugins/acl/acl-lookup-dict.c

index b2d726ae122056c4cb071b3d8ec7e38e508f5017..71c239468703b17b504867fb69c9db5838bd6550 100644 (file)
@@ -220,6 +220,9 @@ int acl_lookup_dict_rebuild(struct acl_lookup_dict *dict)
        unsigned int i, dest, count;
        int ret = 0;
 
+       if (acl_dict == NULL)
+               return 0;
+
        /* get all ACL identifiers with a positive lookup right */
        t_array_init(&ids_arr, 128);
        for (ns = dict->user->namespaces; ns != NULL; ns = ns->next) {
@@ -292,7 +295,8 @@ acl_lookup_dict_iterate_visible_init(struct acl_lookup_dict *dict)
 
        /* iterate through all identifiers that match us, start with the
           first one */
-       acl_lookup_dict_iterate_start(iter);
+       if (acl_dict != NULL)
+               acl_lookup_dict_iterate_start(iter);
        return iter;
 }
 
@@ -302,6 +306,9 @@ acl_lookup_dict_iterate_visible_next(struct acl_lookup_dict_iter *iter)
        const char *key, *value;
        int ret;
 
+       if (iter->dict_iter == NULL)
+               return 0;
+
        ret = dict_iterate(iter->dict_iter, &key, &value);
        if (ret > 0) {
                i_assert(iter->prefix_len < strlen(key));