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>bb10
parent
e4395f3f68
commit
f8badeda72
|
|
@ -2326,7 +2326,7 @@ void QSslSocketPrivate::_q_errorSlot(QAbstractSocket::SocketError error)
|
|||
qCDebug(lcSsl) << "\terrorString =" << q->errorString();
|
||||
#endif
|
||||
// this moves encrypted bytes from plain socket into our buffer
|
||||
if (plainSocket->bytesAvailable()) {
|
||||
if (plainSocket->bytesAvailable() && mode != QSslSocket::UnencryptedMode) {
|
||||
qint64 tmpReadBufferMaxSize = readBufferMaxSize;
|
||||
readBufferMaxSize = 0; // reset temporarily so the plain sockets completely drained drained
|
||||
transmit();
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue