summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorPeter Hartmann <peter.hartmann@nokia.com>2010-08-30 13:43:01 (GMT)
committerPeter Hartmann <peter.hartmann@nokia.com>2010-08-30 13:55:57 (GMT)
commitd686a95ed54b19336affc14c9222de54c9af0e72 (patch)
tree3b8051ecb9ede44324deba7814482ca40b5ed67c /src/network
parente32d8cd49c4e3137889512e3f3a19018b4195970 (diff)
downloadQt-d686a95ed54b19336affc14c9222de54c9af0e72.zip
Qt-d686a95ed54b19336affc14c9222de54c9af0e72.tar.gz
Qt-d686a95ed54b19336affc14c9222de54c9af0e72.tar.bz2
QSslConfiguration: fix crash when accessing null pointer
We were accessing the d-pointer of a QSslConfiguration which is initialized lazily. Reviewed-by: Markus Goetz Task-number: QTBUG-13265
Diffstat (limited to 'src/network')
-rw-r--r--src/network/ssl/qsslsocket.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index 91265f3..f18c629 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -1966,6 +1966,11 @@ void QSslConfigurationPrivate::deepCopyDefaultConfiguration(QSslConfigurationPri
QMutexLocker locker(&globalData()->mutex);
const QSslConfigurationPrivate *global = globalData()->config.constData();
+ if (!global) {
+ ptr = 0;
+ return;
+ }
+
ptr->ref = 1;
ptr->peerCertificate = global->peerCertificate;
ptr->peerCertificateChain = global->peerCertificateChain;