dovecot-2.2: mdbox: Don't crash in storage rebuild if mail's "or...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 17:55:53 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/88a05f387743
changeset: 15283:88a05f387743
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 27 02:55:14 2012 +0300
description:
mdbox: Don't crash in storage rebuild if mail's "original mailbox" metadata is missing.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r 4819306a1f9f -r 88a05f387743 src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c
--- a/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Thu Sep 27 00:19:41 2012 +0300
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c	Thu Sep 27 02:55:14 2012 +0300
@@ -605,8 +605,10 @@
 	if (ret > 0 && !deleted && dbox_file_metadata_read(file) > 0) {
 		mailbox = dbox_file_metadata_get(file,
 						 DBOX_METADATA_ORIG_MAILBOX);
-		mailbox = mailbox_list_get_vname(ctx->default_list, mailbox);
-		mailbox = t_strdup(mailbox);
+		if (mailbox != NULL) {
+			mailbox = mailbox_list_get_vname(ctx->default_list, mailbox);
+			mailbox = t_strdup(mailbox);
+		}
 	}
 	dbox_file_unref(&file);
 	if (ret <= 0 || deleted) {


More information about the dovecot-cvs mailing list