Mercurial > dovecot > core-2.2
changeset 13454:ddb5c2a8f3d2
fts-squat: Crashfixes on indexing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 12 Sep 2011 16:23:21 +0300 |
parents | 600034b77a1c |
children | 74e945315e2c |
files | src/plugins/fts-squat/fts-backend-squat.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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