dovecot-2.0: virtual: Fixed a crash when freeing an allocated, b...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jun 21 18:39:16 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/7d05cef711bb
changeset: 11593:7d05cef711bb
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jun 21 16:39:12 2010 +0100
description:
virtual: Fixed a crash when freeing an allocated, but unopened mailbox.
Based on patch by e-frog.

diffstat:

 src/plugins/virtual/virtual-config.c |  5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diffs (15 lines):

diff -r 08b879b79236 -r 7d05cef711bb src/plugins/virtual/virtual-config.c
--- a/src/plugins/virtual/virtual-config.c	Mon Jun 21 15:46:21 2010 +0100
+++ b/src/plugins/virtual/virtual-config.c	Mon Jun 21 16:39:12 2010 +0100
@@ -400,6 +400,11 @@
 	struct virtual_backend_box *const *bboxes;
 	unsigned int i, count;
 
+	if (!array_is_created(&mbox->backend_boxes)) {
+		/* mailbox wasn't opened */
+		return;
+	}
+
 	bboxes = array_get_modifiable(&mbox->backend_boxes, &count);
 	for (i = 0; i < count; i++) {
 		if (bboxes[i]->search_args != NULL)


More information about the dovecot-cvs mailing list