summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-12-02 10:52:03 -0800
committerJay Sorg <jay.sorg@gmail.com>2014-12-02 10:52:03 -0800
commitd9d746ce5c9afdca0d67e4115c01343dd6ba8ddb (patch)
tree84abd13d331dacc0c8c962cf457f4bfd17d0cb0d /common
parent290aee8cd9859cd0bc3c085b99ca2e02a02f5ffe (diff)
downloadxrdp-proprietary-d9d746ce5c9afdca0d67e4115c01343dd6ba8ddb.tar.gz
xrdp-proprietary-d9d746ce5c9afdca0d67e4115c01343dd6ba8ddb.zip
common: avoid possible SSL_shutdown crash
Diffstat (limited to 'common')
-rw-r--r--common/ssl_calls.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/ssl_calls.c b/common/ssl_calls.c
index 966bbb15..99e9c50e 100644
--- a/common/ssl_calls.c
+++ b/common/ssl_calls.c
@@ -685,14 +685,24 @@ ssl_tls_accept(struct ssl_tls *self)
}
/*****************************************************************************/
+/* returns error, */
int APP_CC
ssl_tls_disconnect(struct ssl_tls *self)
{
- int status = SSL_shutdown(self->ssl);
+ int status;
+
+ if (self == NULL)
+ {
+ return 0;
+ }
+ if (self->ssl == NULL)
+ {
+ return 0;
+ }
+ status = SSL_shutdown(self->ssl);
while (status != 1)
{
status = SSL_shutdown(self->ssl);
-
if (status <= 0)
{
if (ssl_tls_print_error("SSL_shutdown", self->ssl, status))