]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: mailbox_update() crashed if mailbox wasn't yet open.
authorTimo Sirainen <tss@iki.fi>
Wed, 28 Oct 2009 20:01:06 +0000 (16:01 -0400)
committerTimo Sirainen <tss@iki.fi>
Wed, 28 Oct 2009 20:01:06 +0000 (16:01 -0400)
--HG--
branch : HEAD

src/lib-storage/index/maildir/maildir-storage.c

index 5c50b61cff6ea502e026db5e3aaf0d3f3798dfe0..c05dbd59d7550d7f70dc071b17ce56b93df245d1 100644 (file)
@@ -507,6 +507,11 @@ maildir_mailbox_update(struct mailbox *box, const struct mailbox_update *update)
        struct maildir_uidlist *uidlist = mbox->uidlist;
        int ret;
 
+       if (!box->opened) {
+               if (mailbox_open(box) < 0)
+                       return -1;
+       }
+
        if (maildir_uidlist_lock(uidlist) <= 0)
                return -1;