]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
quota: Don't crash if user has quota disabled.
authorTimo Sirainen <tss@iki.fi>
Tue, 28 Sep 2010 15:05:40 +0000 (16:05 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 28 Sep 2010 15:05:40 +0000 (16:05 +0100)
src/plugins/quota/quota-storage.c

index 714f59562825ced1f763f8e7da1b3d40ca0f802e..b742eab0194bbc2171ee787286dd8d2ec62d42d5 100644 (file)
@@ -505,6 +505,9 @@ void quota_mailbox_list_created(struct mailbox_list *list)
        struct quota_root *root;
        bool add;
 
+       if (QUOTA_USER_CONTEXT(list->ns->user) == NULL)
+               return;
+
        /* see if we have a quota explicitly defined for this namespace */
        quota = quota_get_mail_user_quota(list->ns->user);
        root = quota_find_root_for_ns(quota, list->ns);
@@ -566,6 +569,9 @@ void quota_mail_namespaces_created(struct mail_namespace *namespaces)
        struct quota_root *const *roots;
        unsigned int i, count;
 
+       if (QUOTA_USER_CONTEXT(namespaces->user) == NULL)
+               return;
+
        quota = quota_get_mail_user_quota(namespaces->user);
        roots = array_get(&quota->roots, &count);
        for (i = 0; i < count; i++)