changeset 16697:0d966f8d53be

imap: Fixed potential assert crash in APPEND.
author Timo Sirainen <tss@iki.fi>
date Wed, 21 Aug 2013 19:40:54 +0300
parents c4f754d6967e
children 60b8746e6cfe
files src/imap/cmd-append.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/cmd-append.c	Sat Aug 17 15:01:25 2013 +0000
+++ b/src/imap/cmd-append.c	Wed Aug 21 19:40:54 2013 +0300
@@ -829,7 +829,9 @@
 		/* finished - do one more read, to make sure istream-chain
 		   unreferences its stream, which is needed for litinput's
 		   unreferencing to seek the client->input to correct
-		   position */
+		   position. the seek is needed to avoid trying to seek
+		   backwards in the ctx->input's parent stream. */
+		i_stream_seek(ctx->input, ctx->input->v_offset);
 		(void)i_stream_read(ctx->input);
 		i_stream_unref(&ctx->litinput);