From c755589426b0f0de68d0965ecbbabb4d99609199 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 3 Jun 2020 03:36:02 -0500 Subject: [PATCH] Fix crash if empty certificate is provided in PKI list --- src/userconfigdlg.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/userconfigdlg.cpp b/src/userconfigdlg.cpp index 13d4b26..2fac3d6 100644 --- a/src/userconfigdlg.cpp +++ b/src/userconfigdlg.cpp @@ -519,6 +519,10 @@ void UserConfigDialog::updatePKICertificateList() { for (it = m_user.pkiCertificates.begin(); it != m_user.pkiCertificates.end(); ++it) { PKICertificateEntry certificateData = *it; + // Don't attempt to load empty certificates + if (certificateData.second.size() < 1) + continue; + TQCString ssldata(certificateData.second); ssldata[certificateData.second.size()] = 0; ssldata.replace("-----BEGIN CERTIFICATE-----", "");