dovecot-1.2: Don't crash if acl_dict setting is missing.
dovecot at dovecot.org
dovecot at dovecot.org
Wed Nov 19 16:41:50 EET 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/6d5ca089bd1e
changeset: 8441:6d5ca089bd1e
user: Timo Sirainen <tss at iki.fi>
date: Wed Nov 19 16:41:47 2008 +0200
description:
Don't crash if acl_dict setting is missing.
diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
src/plugins/acl/acl-lookup-dict.c | 9 ++++++++-
diffs (33 lines):
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 @@ int acl_lookup_dict_rebuild(struct acl_l
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(str
/* 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;
}
@@ -301,6 +305,9 @@ acl_lookup_dict_iterate_visible_next(str
{
const char *key, *value;
int ret;
+
+ if (iter->dict_iter == NULL)
+ return 0;
ret = dict_iterate(iter->dict_iter, &key, &value);
if (ret > 0) {
More information about the dovecot-cvs
mailing list