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);