]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fixed assert-crash on some error conditions.
authorTimo Sirainen <tss@iki.fi>
Fri, 22 Feb 2013 13:49:35 +0000 (15:49 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 22 Feb 2013 13:49:35 +0000 (15:49 +0200)
src/lib-index/mail-transaction-log-file.c

index a7bdf3988d78e76c57d8f78308e9e790f8aa6013..4f3d827505bb07ebf57d536b63751f1bafa55858 100644 (file)
@@ -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);
        }