summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2020-06-03 03:36:02 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2020-06-03 03:36:02 -0500
commitc755589426b0f0de68d0965ecbbabb4d99609199 (patch)
treeba565493a8654926ed09010d90541a616834502e
parent98d64af7fd07ecbf264538ad6e9eb8e6a7a7e1d0 (diff)
downloadkcmldapmanager-c755589426b0f0de68d0965ecbbabb4d99609199.tar.gz
kcmldapmanager-c755589426b0f0de68d0965ecbbabb4d99609199.zip
Fix crash if empty certificate is provided in PKI list
-rw-r--r--src/userconfigdlg.cpp4
1 files changed, 4 insertions, 0 deletions
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-----", "");