# HG changeset patch # User Timo Sirainen # Date 1227105707 -7200 # Node ID 6d5ca089bd1ee0a05b03574837fc982c36607157 # Parent a3feb99907afc2d17c1233b724d91c9477a6603c Don't crash if acl_dict setting is missing. diff -r a3feb99907af -r 6d5ca089bd1e src/plugins/acl/acl-lookup-dict.c --- a/src/plugins/acl/acl-lookup-dict.c Wed Nov 19 16:34:19 2008 +0200 +++ b/src/plugins/acl/acl-lookup-dict.c Wed Nov 19 16:41:47 2008 +0200 @@ -220,6 +220,9 @@ 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 @@ /* 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 @@ 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));