From: Timo Sirainen Date: Fri, 22 Feb 2013 13:49:35 +0000 (+0200) Subject: lib-index: Fixed assert-crash on some error conditions. X-Git-Tag: 2.2.rc1~1^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2dadd5dacee37d409fa699597bfddc03074e4853;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Fixed assert-crash on some error conditions. --- diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index a7bdf3988d..4f3d827505 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -1683,7 +1683,7 @@ int mail_transaction_log_file_map(struct mail_transaction_log_file *file, } if (MAIL_TRANSACTION_LOG_FILE_IN_MEMORY(file)) { - if (start_offset < file->buffer_offset) { + if (start_offset < file->buffer_offset || file->buffer == NULL) { /* we had moved the log to memory but failed to read the beginning of the log file */ mail_index_set_error(index, @@ -1691,7 +1691,6 @@ int mail_transaction_log_file_map(struct mail_transaction_log_file *file, file->filepath); return 0; } - i_assert(file->buffer != NULL); return log_file_map_check_offsets(file, start_offset, end_offset); }