summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbju <bju@maxi.fritz.box>2018-07-22 13:50:08 (GMT)
committerbju <bju@maxi.fritz.box>2018-07-22 13:50:08 (GMT)
commit3aae70b1b1999055323b16835e385d96bf460fe0 (patch)
treecadb434c9e517c49c39661012758f91b649b6535
parent5ab0feb9daf73aced88e946ef6bc5b5a38fa99b0 (diff)
downloadvdr-manager-3aae70b1b1999055323b16835e385d96bf460fe0.tar.gz
vdr-manager-3aae70b1b1999055323b16835e385d96bf460fe0.tar.bz2
Crash using non-SSL socket
-rw-r--r--vdr-vdrmanager/clientsock.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/vdr-vdrmanager/clientsock.cpp b/vdr-vdrmanager/clientsock.cpp
index 0bce192..4668914 100644
--- a/vdr-vdrmanager/clientsock.cpp
+++ b/vdr-vdrmanager/clientsock.cpp
@@ -399,11 +399,14 @@ bool cVdrmanagerClientSocket::Attach(int fd) {
if (!LoadCerts()) {
return false;
}
- ssl = SSL_new(sslCtx);
- SSL_set_accept_state(ssl);
- BIO *bio = BIO_new_socket(sock, BIO_NOCLOSE);
- SSL_set_bio(ssl, bio, bio);
- BIO_set_nbio(bio, 1);
+
+ if (certFile) {
+ ssl = SSL_new(sslCtx);
+ SSL_set_accept_state(ssl);
+ BIO *bio = BIO_new_socket(sock, BIO_NOCLOSE);
+ SSL_set_bio(ssl, bio, bio);
+ BIO_set_nbio(bio, 1);
+ }
#endif
return true;