[PATCH] Remove dead variable and fix possible null pointer dereference

Wald Commits scm-commit at wald.intevation.org
Fri Sep 26 19:31:56 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1411752713 -7200
# Node ID 2efdf2faf4e510a8e1babace3e549546dd85b2aa
# Parent  d9ecf3a83620eda551025e5223ad006c810ad0f8
Remove dead variable and fix possible null pointer dereference

    Problems found by clang static-analyzer

diff -r d9ecf3a83620 -r 2efdf2faf4e5 ui/createinstallerdialog.cpp
--- a/ui/createinstallerdialog.cpp	Fri Sep 26 19:05:44 2014 +0200
+++ b/ui/createinstallerdialog.cpp	Fri Sep 26 19:31:53 2014 +0200
@@ -464,7 +464,9 @@
     /* Check that it is a 3072 bit RSA key as specified */
     if (!pk.pk_info || pk_get_size(&pk) != 3072 ||
             pk.pk_info->type != POLARSSL_PK_RSA) {
-        qDebug() << pk.pk_info->type << "type";
+        if (pk.pk_info) {
+            qDebug() << pk.pk_info->type << "type";
+        }
         qDebug() << POLARSSL_PK_RSA << "rsa";
         qDebug() << "size " << pk_get_size(&pk);
         showErrorMessage(tr("Only 3072 bit RSA keys are supported by the current format."));
diff -r d9ecf3a83620 -r 2efdf2faf4e5 ui/sslconnection_bare.cpp
--- a/ui/sslconnection_bare.cpp	Fri Sep 26 19:05:44 2014 +0200
+++ b/ui/sslconnection_bare.cpp	Fri Sep 26 19:31:53 2014 +0200
@@ -188,7 +188,6 @@
            qDebug() << "CN mismatch";
         if((ret & BADCERT_NOT_TRUSTED) != 0)
             qDebug() << "self-signed or not signed by a trusted CA";
-        ret = -1;
 #ifdef RELEASE_BUILD
         mErrorState = InvalidCertificate;
         return -1;


More information about the Trustbridge-commits mailing list