]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
virtual plugin: Fixed crash on mailbox_status() if virtual mailbox wasn't opened...
authorTimo Sirainen <tss@iki.fi>
Mon, 28 Sep 2015 13:13:00 +0000 (16:13 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 28 Sep 2015 13:13:00 +0000 (16:13 +0300)
mbox->backend_boxes is initialized only when mailbox is opened.

src/plugins/virtual/virtual-storage.c

index 5c385d7615b5c168fa0f7343b6fc9685b63908b7..d6ce3fbdfd04833f843b2d8dd3940244b99476dd 100644 (file)
@@ -508,6 +508,11 @@ static int virtual_storage_set_have_guid_flags(struct virtual_mailbox *mbox)
        struct mailbox_status status;
        bool opened;
 
+       if (!mbox->box.opened) {
+               if (mailbox_open(&mbox->box) < 0)
+                       return -1;
+       }
+
        mbox->have_guids = TRUE;
        mbox->have_save_guids = TRUE;