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

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 4 15:53:55 EET 2013


details:   http://hg.dovecot.org/dovecot-2.1/rev/a7928075f0fd
changeset: 14931: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