]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed potential assert crash in APPEND.
authorTimo Sirainen <tss@iki.fi>
Wed, 21 Aug 2013 16:40:54 +0000 (19:40 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 21 Aug 2013 16:40:54 +0000 (19:40 +0300)
src/imap/cmd-append.c

index 70d2c7a91e64ad42b7dbd77bb953b7ae0e1c2317..791151055d64df942b2a01f7623360641e86ee64 100644 (file)
@@ -829,7 +829,9 @@ static bool cmd_append_continue_message(struct client_command_context *cmd)
                /* 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);