Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6320:58b6fb965e62 HEAD
If keyword ext record is missing, log an error instead of assert-crashing.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 27 Aug 2007 17:55:05 +0300 |
parents | c2c8ee636157 |
children | 840bd34df909 |
files | src/lib-index/mail-index-sync-keywords.c |
diffstat | 1 files changed, 7 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-keywords.c Mon Aug 27 17:47:25 2007 +0300 +++ b/src/lib-index/mail-index-sync-keywords.c Mon Aug 27 17:55:05 2007 +0300 @@ -273,16 +273,14 @@ } ext_id = mail_index_map_lookup_ext(ctx->view->map, "keywords"); - if (ext_id == (uint32_t)-1) { + ext = ext_id == (uint32_t)-1 ? NULL : + array_idx(&ctx->view->map->extensions, ext_id); + if (ext == NULL || ext->record_size == 0) { /* nothing to do */ - i_assert(rec->modify_type == MODIFY_REMOVE); - return 1; - } - - ext = array_idx(&ctx->view->map->extensions, ext_id); - if (ext->record_size == 0) { - /* nothing to do */ - i_assert(rec->modify_type == MODIFY_REMOVE); + if (rec->modify_type != MODIFY_REMOVE) { + mail_index_sync_set_corrupted(ctx, + "Keyword ext record missing for added keyword"); + } return 1; }