[Commits] [SCM] claws branch, master, updated. 3.15.0-108-g5641384

ticho at claws-mail.org ticho at claws-mail.org
Wed Jul 12 23:54:21 CEST 2017


The branch, master has been updated
       via  56413842f2f1dd1de548195aee7377be194bdbe5 (commit)
       via  8c85b626a0f78960eff5b32ee719b5ea3603f5e2 (commit)
      from  1de6ad1ddacaf5fac71b9592b4a474c9ee9cd277 (commit)

Summary of changes:
 src/common/ssl_certificate.c |    2 +-
 src/ssl_manager.c            |    8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 56413842f2f1dd1de548195aee7377be194bdbe5
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Jul 12 23:52:06 2017 +0200

    Fix a memory leak in get_fingerprint().

diff --git a/src/ssl_manager.c b/src/ssl_manager.c
index 4a7db9d..60042cc 100644
--- a/src/ssl_manager.c
+++ b/src/ssl_manager.c
@@ -242,7 +242,7 @@ static gboolean get_serverport(const gchar *str, gchar **server, gchar **port)
 
 static char *get_fingerprint(const char *str)
 {
-	char *ret = NULL, *tmp = g_strdup(str);
+	char *ret = NULL, *tmp = g_strdup(str), *tmp2 = tmp;
 	char *previous_pos = NULL, *last_pos = NULL;
 
 	if (!strchr(tmp, ':')) {
@@ -251,10 +251,10 @@ static char *get_fingerprint(const char *str)
 			*(strstr(tmp, ".cert")+1) = '.';
 	}
 
-	while (tmp && (tmp = strstr(tmp,".")) != NULL) {
-		tmp++;
+	while (tmp2 && (tmp2 = strstr(tmp2,".")) != NULL) {
+		tmp2++;
 		previous_pos = last_pos;
-		last_pos = tmp;
+		last_pos = tmp2;
 	}
 	if (last_pos && previous_pos && (int)(last_pos - previous_pos - 1) > 0)
 		ret = g_strndup(previous_pos, (int)(last_pos - previous_pos - 1));

commit 8c85b626a0f78960eff5b32ee719b5ea3603f5e2
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Wed Jul 12 23:47:39 2017 +0200

    Fixed an uninitialized variable use in check_cert().

diff --git a/src/common/ssl_certificate.c b/src/common/ssl_certificate.c
index 0a1d02b..75b61e6 100644
--- a/src/common/ssl_certificate.c
+++ b/src/common/ssl_certificate.c
@@ -550,7 +550,7 @@ static guint check_cert(SSLCertificate *cert)
 	g_free(buf);
 	if (is_file_exist(chain_file)) {
 		unsigned char md[128];
-		size_t n;
+		size_t n = 128;
 		char *fingerprint;
 
 		fp = g_fopen(chain_file, "r");

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list