dovecot-2.0: dbox: Fixed wrong error check while reading externa...

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 14 19:43:35 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/890a46b3ab63
changeset: 12678:890a46b3ab63
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 14 19:43:31 2011 +0200
description:
dbox: Fixed wrong error check while reading external attachments.

diffstat:

 src/lib-storage/index/dbox-common/dbox-attachment.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (24 lines):

diff -r 0a1a0d33c1b2 -r 890a46b3ab63 src/lib-storage/index/dbox-common/dbox-attachment.c
--- a/src/lib-storage/index/dbox-common/dbox-attachment.c	Sat Mar 12 17:43:46 2011 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-attachment.c	Mon Mar 14 19:43:31 2011 +0200
@@ -170,9 +170,6 @@
 		if (extref->start_offset != last_voffset) {
 			uoff_t part_size = extref->start_offset - last_voffset;
 
-			input = i_stream_create_limit(*stream, part_size);
-			array_append(&streams, &input, 1);
-			i_stream_seek(*stream, (*stream)->v_offset + part_size);
 			if ((*stream)->v_offset + part_size > psize) {
 				*error_r = t_strdup_printf(
 					"ext-refs point outside message "
@@ -180,6 +177,10 @@
 					(*stream)->v_offset, part_size, psize);
 				ret = 0;
 			}
+
+			input = i_stream_create_limit(*stream, part_size);
+			array_append(&streams, &input, 1);
+			i_stream_seek(*stream, (*stream)->v_offset + part_size);
 			last_voffset += part_size;
 		}
 


More information about the dovecot-cvs mailing list