dovecot-2.1: lib-ssl-iostream: Avoid assert-crashing when remote...

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 5 14:23:23 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/44bbbb238f2a
changeset: 13402:44bbbb238f2a
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 05 14:23:11 2011 +0300
description:
lib-ssl-iostream: Avoid assert-crashing when remote disconnects during write.

diffstat:

 src/lib-ssl-iostream/iostream-openssl.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (16 lines):

diff -r 4124c28db2a4 -r 44bbbb238f2a src/lib-ssl-iostream/iostream-openssl.c
--- a/src/lib-ssl-iostream/iostream-openssl.c	Mon Sep 05 12:46:49 2011 +0300
+++ b/src/lib-ssl-iostream/iostream-openssl.c	Mon Sep 05 14:23:11 2011 +0300
@@ -264,6 +264,12 @@
 		i_assert(ret == (int)bytes);
 
 		sent = o_stream_send(ssl_io->plain_output, buffer, bytes);
+		if (sent < 0) {
+			i_assert(ssl_io->plain_output->stream_errno != 0);
+			ssl_io->ssl_output->stream_errno =
+				ssl_io->plain_output->stream_errno;
+			break;
+		}
 		i_assert(sent == (ssize_t)bytes);
 		bytes_sent = TRUE;
 	}


More information about the dovecot-cvs mailing list