From: Timo Sirainen Date: Sun, 30 Mar 2008 08:41:35 +0000 (+0300) Subject: Fix to previous optimization: Don't crash if we want to read older data from X-Git-Tag: 1.1.rc4~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7184b2f499d5b8977671e92310148da72170edca;p=thirdparty%2Fdovecot%2Fcore.git Fix to previous optimization: Don't crash if we want to read older data from transaction log. --HG-- branch : HEAD --- diff --git a/src/lib-index/mail-transaction-log-file.c b/src/lib-index/mail-transaction-log-file.c index eb88fcb7c6..cb1f2dfc9a 100644 --- a/src/lib-index/mail-transaction-log-file.c +++ b/src/lib-index/mail-transaction-log-file.c @@ -1065,7 +1065,7 @@ mail_transaction_log_file_map_mmap(struct mail_transaction_log_file *file, return 0; } - if (file->buffer != NULL && + if (file->buffer != NULL && file->buffer_offset <= start_offset && (uoff_t)st.st_size == file->buffer_offset + file->buffer->used) { /* we already have the whole file mapped */ if ((ret = mail_transaction_log_file_sync(file)) < 0)