dovecot-2.2: lib-storage: Fixed assert-crash when trying to fetc...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Dec 18 10:44:42 EET 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/cde6da31e6ec
changeset: 15486:cde6da31e6ec
user: Timo Sirainen <tss at iki.fi>
date: Tue Dec 18 10:44:28 2012 +0200
description:
lib-storage: Fixed assert-crash when trying to fetch a binary section for empty message.
diffstat:
src/lib-storage/index/index-mail-binary.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diffs (30 lines):
diff -r 58fdb8ded6b7 -r cde6da31e6ec src/lib-storage/index/index-mail-binary.c
--- a/src/lib-storage/index/index-mail-binary.c Sat Dec 15 15:33:12 2012 +0200
+++ b/src/lib-storage/index/index-mail-binary.c Tue Dec 18 10:44:28 2012 +0200
@@ -344,8 +344,8 @@
i_assert(ret == -1);
if (full_input->stream_errno != 0)
return -1;
- i_assert(!i_stream_have_bytes_left(cur_block->input));
- i_assert(block_idx+1 == block_count);
+ i_assert(block_count == 0 || !i_stream_have_bytes_left(cur_block->input));
+ i_assert(block_count == 0 || block_idx+1 == block_count);
return 0;
}
@@ -380,8 +380,13 @@
cache->orig_physical_pos = part->physical_pos;
cache->include_hdr = include_hdr;
- cache->input = i_streams_merge(blocks_get_streams(&ctx),
- IO_BLOCK_SIZE, fd_callback, _mail);
+ if (array_count(&ctx.blocks) != 0) {
+ cache->input = i_streams_merge(blocks_get_streams(&ctx),
+ IO_BLOCK_SIZE,
+ fd_callback, _mail);
+ } else {
+ cache->input = i_stream_create_from_data("", 0);
+ }
i_stream_set_name(cache->input, t_strdup_printf(
"<binary stream of mailbox %s UID %u>",
_mail->box->vname, _mail->uid));
More information about the dovecot-cvs
mailing list