]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Set max buffer size for CATENATE istream-chain
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 30 Oct 2017 11:58:54 +0000 (13:58 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 1 Nov 2017 11:45:51 +0000 (13:45 +0200)
This fixes a crash with mbox when nonexistent CATENATE URL is attempted to
be used. The istream doesn't get any size, and istream-header-filter panics
due to having reached the maximum buffer size (0), even though the stream is
empty and there's nothing to read.

src/imap/cmd-append.c

index 823e675ef01a2529872ea01e2a33abbacc5e2eae..a630b9c8de06508653842ec4983d5de4a6cbea71 100644 (file)
@@ -563,6 +563,7 @@ cmd_append_handle_args(struct client_command_context *cmd,
        if (cat_list != NULL) {
                ctx->cat_msg_size = 0;
                ctx->input = i_stream_create_chain(&ctx->catchain);
+               i_stream_set_max_buffer_size(ctx->input, IO_BLOCK_SIZE);
        } else {
                if (ctx->literal_size == 0) {
                        /* no message data, abort */