summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2020-06-03 05:12:21 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2020-06-03 05:12:21 -0500
commite7f58ab193f71250071a80b730189d8850bd80d7 (patch)
treeb7ad98a85eb57226e92454af9436679f3bc1529f
parentc755589426b0f0de68d0965ecbbabb4d99609199 (diff)
downloadkcmldapmanager-e7f58ab193f71250071a80b730189d8850bd80d7.tar.gz
kcmldapmanager-e7f58ab193f71250071a80b730189d8850bd80d7.zip
Fix a few more potential crashes when attempting to load empty certificates
-rw-r--r--src/userconfigdlg.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/userconfigdlg.cpp b/src/userconfigdlg.cpp
index 2fac3d6..f42325c 100644
--- a/src/userconfigdlg.cpp
+++ b/src/userconfigdlg.cpp
@@ -402,6 +402,10 @@ void UserConfigDialog::downloadPKICertificate() {
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-----", "");
@@ -444,6 +448,10 @@ void UserConfigDialog::revokePKICertificate() {
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-----", "");