dovecot-2.2: lib-ssl-iostream: Fixed potential assert-crash when...

dovecot at dovecot.org dovecot at dovecot.org
Sun Nov 4 20:04:32 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/edc604cba6e1
changeset: 15376:edc604cba6e1
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Nov 04 20:04:21 2012 +0200
description:
lib-ssl-iostream: Fixed potential assert-crash when reading.

diffstat:

 src/lib-ssl-iostream/istream-openssl.c |  5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diffs (15 lines):

diff -r 09da0c7d23bd -r edc604cba6e1 src/lib-ssl-iostream/istream-openssl.c
--- a/src/lib-ssl-iostream/istream-openssl.c	Sun Nov 04 19:16:59 2012 +0200
+++ b/src/lib-ssl-iostream/istream-openssl.c	Sun Nov 04 20:04:21 2012 +0200
@@ -85,10 +85,7 @@
 	sstream->ssl_io->input_handler = FALSE;
 	stream->max_buffer_size = (size_t)-1;
 	while ((ret = SSL_read(ssl_io->ssl, buffer, sizeof(buffer))) > 0) {
-		if (!i_stream_try_alloc(stream, ret, &size))
-			i_unreached();
-		i_assert(size >= (size_t)ret);
-		memcpy(stream->w_buffer + stream->pos, buffer, ret);
+		memcpy(i_stream_alloc(stream, ret), buffer, ret);
 		stream->pos += ret;
 		total_ret += ret;
 	}


More information about the dovecot-cvs mailing list