dovecot-2.0-sslstream: lib-index: Replaced ext-header update ass...

dovecot at dovecot.org dovecot at dovecot.org
Sat Feb 13 02:56:39 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0-sslstream/rev/711fbedaad9d
changeset: 10386:711fbedaad9d
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Nov 23 11:41:29 2009 -0500
description:
lib-index: Replaced ext-header update assert with "index corrupted" error handling.

diffstat:

1 file changed, 5 insertions(+), 1 deletion(-)
src/lib-index/mail-index-sync-ext.c |    6 +++++-

diffs (16 lines):

diff -r 247f137f17d8 -r 711fbedaad9d src/lib-index/mail-index-sync-ext.c
--- a/src/lib-index/mail-index-sync-ext.c	Mon Nov 23 11:16:35 2009 -0500
+++ b/src/lib-index/mail-index-sync-ext.c	Mon Nov 23 11:41:29 2009 -0500
@@ -619,7 +619,11 @@ int mail_index_sync_ext_hdr_update(struc
 		return 1;
 
 	ext = array_idx(&map->extensions, ctx->cur_ext_map_idx);
-	i_assert(ext->hdr_offset + offset + size <= map->hdr.header_size);
+	if (ext->hdr_offset + offset + size > map->hdr.header_size) {
+		mail_index_sync_set_corrupted(ctx,
+			"Extension header update points outside header size");
+		return -1;
+	}
 
 	buffer_write(map->hdr_copy_buf, ext->hdr_offset + offset, data, size);
 	map->hdr_base = map->hdr_copy_buf->data;


More information about the dovecot-cvs mailing list