dovecot-2.2: dbox: Crashfix on some failed save error conditions.

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 20 21:45:49 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/a7928075f0fd
changeset: 16077:a7928075f0fd
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Mar 04 15:53:42 2013 +0200
description:
dbox: Crashfix on some failed save error conditions.

diffstat:

 src/lib-storage/index/dbox-common/dbox-save.c |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diffs (22 lines):

diff -r 09fcb43c47a4 -r a7928075f0fd src/lib-storage/index/dbox-common/dbox-save.c
--- a/src/lib-storage/index/dbox-common/dbox-save.c	Mon Mar 04 15:18:08 2013 +0200
+++ b/src/lib-storage/index/dbox-common/dbox-save.c	Mon Mar 04 15:53:42 2013 +0200
@@ -106,10 +106,14 @@
 			ctx->failed = TRUE;
 	}
 	if (ctx->ctx.output != dbox_output) {
-		/* e.g. zlib plugin had changed this */
-		o_stream_ref(dbox_output);
-		o_stream_destroy(&ctx->ctx.output);
-		ctx->ctx.output = dbox_output;
+		if (ctx->ctx.output != NULL) {
+			/* e.g. zlib plugin had changed this */
+			o_stream_ref(dbox_output);
+			o_stream_destroy(&ctx->ctx.output);
+			ctx->ctx.output = dbox_output;
+		} else {
+			i_assert(ctx->failed);
+		}
 	}
 	index_mail_cache_parse_deinit(ctx->ctx.dest_mail,
 				      ctx->ctx.received_date, !ctx->failed);


More information about the dovecot-cvs mailing list