From 6763e059c34fe6039525ee47f26ea43665ce67e1 Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Wed, 4 Dec 2013 15:36:25 +0100 Subject: [PATCH] tls: handle the case if endpoint has disconnected --- libfreerdp/crypto/tls.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 3b97486b5..a4d2c6f19 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -382,6 +382,11 @@ int tls_read(rdpTls* tls, BYTE* data, int length) status = SSL_read(tls->ssl, data, length); + if (status == 0) + { + return -1; /* peer disconnected */ + } + if (status <= 0) { error = SSL_get_error(tls->ssl, status);