[Commits] [SCM] claws branch, master, updated. 3.17.3-32-g3390afd

ticho at claws-mail.org ticho at claws-mail.org
Fri Jan 4 19:44:10 CET 2019


The branch, master has been updated
       via  3390afd2245d5100c80ec5afc4d8233413edffbd (commit)
      from  07730d30f9524e8177cfda34aba354af3eeb9120 (commit)

Summary of changes:
 src/gtk/sslcertwindow.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 3390afd2245d5100c80ec5afc4d8233413edffbd
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Fri Jan 4 19:43:31 2019 +0100

    Fix an impossible to trigger buffer overflow
    
    Gets rid of CID 1442278.

diff --git a/src/gtk/sslcertwindow.c b/src/gtk/sslcertwindow.c
index c2748d8..32c8e7b 100644
--- a/src/gtk/sslcertwindow.c
+++ b/src/gtk/sslcertwindow.c
@@ -27,6 +27,7 @@
 
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
+#include <gnutls/crypto.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <stdio.h>
@@ -151,9 +152,12 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 			ret = gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_SHA1, md, &n);
 	}
 
-	if (ret != 0)
+	if (ret != 0) {
 		g_warning("failed to obtain SHA1 fingerprint: %d", ret);
-	sha1_fingerprint = readable_fingerprint(md, (int)n); /* all zeroes */
+		sha1_fingerprint = g_strdup("-");
+	} else {
+		sha1_fingerprint = readable_fingerprint(md, (int)n);
+	}
 
 	n = 0;
 	memset(md, 0, sizeof(md));
@@ -162,9 +166,12 @@ static GtkWidget *cert_presenter(SSLCertificate *cert)
 			ret = gnutls_x509_crt_get_fingerprint(cert->x509_cert, GNUTLS_DIG_SHA256, md, &n);
 	}
 
-	if (ret != 0)
+	if (ret != 0) {
 		g_warning("failed to obtain SHA256 fingerprint: %d", ret);
-	sha256_fingerprint = readable_fingerprint(md, (int)n); /* all zeroes */
+		sha256_fingerprint = g_strdup("-");
+	} else {
+		sha256_fingerprint = readable_fingerprint(md, (int)n);
+	}
 
 
 	/* signature */

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list