dovecot-2.1: lib-index: If cache file unexpectedly shrinks in he...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Oct 26 11:37:23 EEST 2012
details: http://hg.dovecot.org/dovecot-2.1/rev/7fde3830215e
changeset: 14785:7fde3830215e
user: Timo Sirainen <tss at iki.fi>
date: Fri Oct 26 11:34:25 2012 +0300
description:
lib-index: If cache file unexpectedly shrinks in header lookup, log an error.
diffstat:
src/lib-index/mail-cache-lookup.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diffs (22 lines):
diff -r b41d2eec320b -r 7fde3830215e src/lib-index/mail-cache-lookup.c
--- a/src/lib-index/mail-cache-lookup.c Fri Oct 26 11:33:22 2012 +0300
+++ b/src/lib-index/mail-cache-lookup.c Fri Oct 26 11:34:25 2012 +0300
@@ -538,9 +538,16 @@
/* then start filling dest buffer from the headers */
for (i = 0; i < count; i++) {
- if (mail_cache_map(cache, lines[i].data->offset,
- lines[i].data->data_size, &data) <= 0)
+ ret = mail_cache_map(cache, lines[i].data->offset,
+ lines[i].data->data_size, &data);
+ if (ret <= 0) {
+ if (ret < 0)
+ return -1;
+
+ mail_cache_set_corrupted(cache,
+ "header record unexpectedly points outside file");
return -1;
+ }
start = data;
end = start + lines[i].data->data_size;
More information about the dovecot-cvs
mailing list