summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls/schannel/qx509_schannel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tls/schannel/qx509_schannel.cpp')
-rw-r--r--src/plugins/tls/schannel/qx509_schannel.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/tls/schannel/qx509_schannel.cpp b/src/plugins/tls/schannel/qx509_schannel.cpp
index 46be873a7d..d9d82dce29 100644
--- a/src/plugins/tls/schannel/qx509_schannel.cpp
+++ b/src/plugins/tls/schannel/qx509_schannel.cpp
@@ -41,10 +41,11 @@ QSslCertificate X509CertificateSchannel::QSslCertificate_from_CERT_CONTEXT(const
QByteArray derData = QByteArray((const char *)certificateContext->pbCertEncoded,
certificateContext->cbCertEncoded);
QSslCertificate certificate(derData, QSsl::Der);
-
- auto *certBackend = QTlsBackend::backend<X509CertificateSchannel>(certificate);
- Q_ASSERT(certBackend);
- certBackend->certificateContext = CertDuplicateCertificateContext(certificateContext);
+ if (!certificate.isNull()) {
+ auto *certBackend = QTlsBackend::backend<X509CertificateSchannel>(certificate);
+ Q_ASSERT(certBackend);
+ certBackend->certificateContext = CertDuplicateCertificateContext(certificateContext);
+ }
return certificate;
}