SSLButton: Fix a crash
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 23 Mar 2015 17:28:51 +0000 (18:28 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Mon, 23 Mar 2015 17:30:53 +0000 (18:30 +0100)
Made with danimo.
Attempt to fix a crash seen on breakpad reports.
(cc06b990-0c10-40eb-bcec-4d3902150320)

src/gui/sslbutton.cpp

index 226dc54ede46590a18e4c54b4bb190d4c26ad619..d7768b5c5505a6875be061b84c67d9863954fedc 100644 (file)
@@ -190,6 +190,12 @@ void SslButton::updateAccountState(AccountState *accountState)
         setToolTip(tr("This connection is encrypted using %1 bit %2.\n").arg(cipher.usedBits()).arg(cipher.name()));
         QMenu *menu = new QMenu(this);
         QList<QSslCertificate> chain = account->sslConfiguration().peerCertificateChain();
+
+        if (chain.isEmpty()) {
+            qWarning() << "empty certificate chain";
+            return;
+        }
+
         menu->addAction(tr("Certificate information:"))->setEnabled(false);
 
         QList<QSslCertificate> tmpChain;