From: Timo Sirainen Date: Wed, 19 Nov 2008 14:41:47 +0000 (+0200) Subject: Don't crash if acl_dict setting is missing. X-Git-Tag: 1.2.alpha4~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=372d3167088e17ccece2b922961c05cb8a7e4e03;p=thirdparty%2Fdovecot%2Fcore.git Don't crash if acl_dict setting is missing. --HG-- branch : HEAD --- diff --git a/src/plugins/acl/acl-lookup-dict.c b/src/plugins/acl/acl-lookup-dict.c index b2d726ae12..71c2394687 100644 --- a/src/plugins/acl/acl-lookup-dict.c +++ b/src/plugins/acl/acl-lookup-dict.c @@ -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));