diff options
author | Richard Moore <rich@kde.org> | 2011-12-02 18:10:59 +0000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-07 12:55:28 +0100 |
commit | 2757a5fe8cdfe7e23bc8a609b89d47b08d39c0bc (patch) | |
tree | d5d55613fc9fa872f2680dd6f82f0fdf7684ae79 /src/network | |
parent | 47df12225918ba82abe35921af19e547717da58b (diff) |
Check we're connected before startClientEncryption()
The docs say this is required, but we don't check it and instead
segfault right now.
Change-Id: I825b00a312a481c5383af127333c0c4698188348
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 05f50af6f1..e3dd6ae0c5 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1630,6 +1630,10 @@ void QSslSocket::startClientEncryption() qWarning("QSslSocket::startClientEncryption: cannot start handshake on non-plain connection"); return; } + if (state() != ConnectedState) { + qWarning("QSslSocket::startClientEncryption: cannot start handshake when not connected"); + return; + } #ifdef QSSLSOCKET_DEBUG qDebug() << "QSslSocket::startClientEncryption()"; #endif |