summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_schannel.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2020-12-04 12:01:03 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2020-12-04 17:00:15 +0100
commitf8badeda72813ee4d32e7672c4a98373cb7b5d60 (patch)
tree5389a635ac21ac12647f67de4c481e7ed91684e2 /src/network/ssl/qsslsocket_schannel.cpp
parente4395f3f680ec30ad6be4eadf7cf0e1ff64d7615 (diff)
QSslSocket: Don't call 'transmit' in unencrypted mode
At the same time I'll add a generic protection against being called in unprotected mode in the schannel backend (openssl already has it in a different form). Pick-to: 5.15 6.0 Change-Id: I97c1be6239c27e306de0af7ad568fbcfde09da71 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/ssl/qsslsocket_schannel.cpp')
-rw-r--r--src/network/ssl/qsslsocket_schannel.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket_schannel.cpp b/src/network/ssl/qsslsocket_schannel.cpp
index 051eb3fc3f..1c482f56d7 100644
--- a/src/network/ssl/qsslsocket_schannel.cpp
+++ b/src/network/ssl/qsslsocket_schannel.cpp
@@ -1325,6 +1325,9 @@ void QSslSocketBackendPrivate::transmit()
{
Q_Q(QSslSocket);
+ if (mode == QSslSocket::UnencryptedMode)
+ return; // This function should not have been called
+
// Can happen if called through QSslSocket::abort->QSslSocket::close->QSslSocket::flush->here
if (plainSocket->state() == QAbstractSocket::SocketState::UnconnectedState)
return;