dovecot-2.1: fts-squat: Crashfixes on indexing.

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 12 16:23:30 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/ddb5c2a8f3d2
changeset: 13454:ddb5c2a8f3d2
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 12 16:23:21 2011 +0300
description:
fts-squat: Crashfixes on indexing.

diffstat:

 src/plugins/fts-squat/fts-backend-squat.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 600034b77a1c -r ddb5c2a8f3d2 src/plugins/fts-squat/fts-backend-squat.c
--- a/src/plugins/fts-squat/fts-backend-squat.c	Mon Sep 12 16:18:56 2011 +0300
+++ b/src/plugins/fts-squat/fts-backend-squat.c	Mon Sep 12 16:23:21 2011 +0300
@@ -101,7 +101,7 @@
 fts_backend_squat_set_box(struct squat_fts_backend *backend,
 			  struct mailbox *box)
 {
-	const struct mailbox_permissions *perm = mailbox_get_permissions(box);
+	const struct mailbox_permissions *perm;
 	struct mail_storage *storage;
 	struct mailbox_status status;
 	const char *path;
@@ -110,7 +110,10 @@
 	if (backend->box == box)
 		return;
 	fts_backend_squat_unset_box(backend);
+	if (box == NULL)
+		return;
 
+	perm = mailbox_get_permissions(box);
 	storage = mailbox_get_storage(box);
 	path = mailbox_list_get_path(box->list, box->name,
 				     MAILBOX_LIST_PATH_TYPE_INDEX);
@@ -255,8 +258,10 @@
 		ctx->failed = TRUE;
 	fts_backend_squat_set_box(backend, box);
 
-	if (squat_trie_build_init(backend->trie, &ctx->build_ctx) < 0)
-		ctx->failed = TRUE;
+	if (box != NULL) {
+		if (squat_trie_build_init(backend->trie, &ctx->build_ctx) < 0)
+			ctx->failed = TRUE;
+	}
 }
 
 static void


More information about the dovecot-cvs mailing list