[Commits] [SCM] claws branch, master, updated. 3.12.0-116-g72f8521

Colin colin at claws-mail.org
Thu Oct 8 19:23:18 CEST 2015


The branch, master has been updated
       via  72f85216a0f01cc88e45116a3fa59757f2cfc019 (commit)
       via  84f1556050df9d3f305b40e49a08e5aed2ff2fc4 (commit)
       via  8b44c9d2c43aee4bcbbd3718cc52b6861f5223d7 (commit)
       via  6fd294c50f230f75c2f764148cd6005cb4a62094 (commit)
       via  ea54e7760f270f4f8a6666cc2315e48daf0b0110 (commit)
       via  542c66f3f813801b9eeab84432d2e01e4a890aee (commit)
       via  47d362fb39527b0f100cdc8c247a472767b6554e (commit)
      from  0bc73a08fc82333fd27730cf721d5c6e2593f68e (commit)

Summary of changes:
 src/addr_compl.c                          |    4 +++-
 src/compose.c                             |    5 ++++-
 src/etpan/imap-thread.c                   |    3 +++
 src/gtk/gtkcmclist.c                      |    4 +++-
 src/imap.c                                |    7 +++++--
 src/jpilot.c                              |    1 +
 src/plugins/clamd/libclamd/clamd-plugin.c |    4 ++--
 src/send_message.c                        |    5 ++++-
 src/textview.c                            |    6 ++++--
 9 files changed, 29 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit 72f85216a0f01cc88e45116a3fa59757f2cfc019
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:23:15 2015 +0200

    Fix missing check

diff --git a/src/textview.c b/src/textview.c
index a6cceaa..5962823 100644
--- a/src/textview.c
+++ b/src/textview.c
@@ -1079,8 +1079,10 @@ static void textview_write_body(TextView *textview, MimeInfo *mimeinfo)
 		filename = procmime_get_tmp_file_name(mimeinfo);
 		if (procmime_get_part(filename, mimeinfo) == 0) {
 			tmpfp = g_fopen(filename, "rb");
-			textview_show_html(textview, tmpfp, conv);
-			fclose(tmpfp);
+			if (tmpfp) {
+				textview_show_html(textview, tmpfp, conv);
+				fclose(tmpfp);
+			}
 			claws_unlink(filename);
 		}
 		g_free(filename);

commit 84f1556050df9d3f305b40e49a08e5aed2ff2fc4
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:22:06 2015 +0200

    Fix missing check

diff --git a/src/send_message.c b/src/send_message.c
index da79f5a..be2733d 100644
--- a/src/send_message.c
+++ b/src/send_message.c
@@ -236,7 +236,10 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g
 		return -1;
 	}
 	tmp_msginfo = procheader_parse_stream(fp, flags, TRUE, FALSE);
-	fseek(fp, fp_pos, SEEK_SET);
+	if (fseek(fp, fp_pos, SEEK_SET) < 0) {
+		perror("fseek");
+		return -1;
+	}
 
 	if (tmp_msginfo && tmp_msginfo->extradata && tmp_msginfo->extradata->resent_from) {
 		strncpy2(spec_from, tmp_msginfo->extradata->resent_from, BUFFSIZE-1);

commit 8b44c9d2c43aee4bcbbd3718cc52b6861f5223d7
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:18:53 2015 +0200

    Fix resource leak

diff --git a/src/jpilot.c b/src/jpilot.c
index fde63ce..43f58f4 100644
--- a/src/jpilot.c
+++ b/src/jpilot.c
@@ -872,6 +872,7 @@ static gint jpilot_read_db_files( JPilotFile *pilotFile, GList **records ) {
 			}
 		}
 		if (fseek( in, next_offset, SEEK_SET ) < 0) {
+			free_mem_rec_header( &mem_rh );
 			fclose(in);
 			return MGU_ERROR_READ;
 		}

commit 6fd294c50f230f75c2f764148cd6005cb4a62094
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:16:52 2015 +0200

    Fix null pointer dereferences and missing return checks

diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c
index f1c555d..ffe0598 100644
--- a/src/etpan/imap-thread.c
+++ b/src/etpan/imap-thread.c
@@ -935,6 +935,9 @@ int imap_threaded_login(Folder * folder,
 	
 	debug_print("imap login - begin\n");
 	
+	if (!folder)
+		return MAILIMAP_ERROR_INVAL;
+
 	param.imap = get_imap(folder);
 	param.login = login;
 	param.password = password;
diff --git a/src/gtk/gtkcmclist.c b/src/gtk/gtkcmclist.c
index 737b278..e58f8c5 100644
--- a/src/gtk/gtkcmclist.c
+++ b/src/gtk/gtkcmclist.c
@@ -7417,7 +7417,9 @@ gtk_cmclist_merge (GtkCMCList *clist,
 	}
     }
 
-  z.next->prev = NULL;
+  if (z.next)
+	z.next->prev = NULL;
+
   return z.next;
 }
 
diff --git a/src/imap.c b/src/imap.c
index ad476ff..79b1a89 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -2000,8 +2000,11 @@ static gint imap_do_copy_msgs(Folder *folder, FolderItem *dest,
 				if (!is_dir_exist(cache_path))
 					make_dir_hier(cache_path);
 				if (is_file_exist(real_file) && is_dir_exist(cache_path)) {
-					copy_file(real_file, cache_file, TRUE);
-					debug_print("copied to cache: %s\n", cache_file);
+					if (copy_file(real_file, cache_file, TRUE) < 0)
+						debug_print("couldn't cache to %s: %s\n", cache_file,
+							    strerror(errno));
+					else
+						debug_print("copied to cache: %s\n", cache_file);
 				}
 				g_free(real_file);
 				g_free(cache_file);

commit ea54e7760f270f4f8a6666cc2315e48daf0b0110
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:13:17 2015 +0200

    Fix unchecked return value

diff --git a/src/compose.c b/src/compose.c
index 285158f..ed92268 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9443,7 +9443,10 @@ static gboolean compose_input_cb(GIOChannel *source, GIOCondition condition,
 
 	debug_print("Compose: input from monitoring process\n");
 
-	g_io_channel_read_chars(source, buf, sizeof(buf), &bytes_read, NULL);
+	if (g_io_channel_read_chars(source, buf, sizeof(buf), &bytes_read, NULL) != G_IO_STATUS_NORMAL) {
+		bytes_read = 0;
+		buf[0] = '\0';
+	}
 
 	g_io_channel_shutdown(source, FALSE, NULL);
 	g_io_channel_unref(source);

commit 542c66f3f813801b9eeab84432d2e01e4a890aee
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:08:42 2015 +0200

    Fix null pointer dereference

diff --git a/src/addr_compl.c b/src/addr_compl.c
index 44303a6..61d158b 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -187,7 +187,9 @@ static gint weight_addr_match(const address_entry* addr)
 	gint	a_weight = addr->address ? strlen(addr->address) : n_weight;
 	gchar* 	match = NULL;
 
-	match = strcasestr(addr->name, g_completion_prefix);
+	if (addr->name)
+		match = strcasestr(addr->name, g_completion_prefix);
+
 	if (match != NULL) {
 		if (match == addr->name)
 			n_weight = -4;

commit 47d362fb39527b0f100cdc8c247a472767b6554e
Author: Colin Leroy <colin at colino.net>
Date:   Thu Oct 8 19:08:23 2015 +0200

    Fix possibly not null-terminated string

diff --git a/src/plugins/clamd/libclamd/clamd-plugin.c b/src/plugins/clamd/libclamd/clamd-plugin.c
index b50fb90..5f58cfa 100644
--- a/src/plugins/clamd/libclamd/clamd-plugin.c
+++ b/src/plugins/clamd/libclamd/clamd-plugin.c
@@ -389,7 +389,7 @@ Clamd_Stat clamd_init(Clamd_Socket* config) {
 	}
 	memset(buf, '\0', sizeof(buf));
         while ((n_read = read(sock, buf, sizeof(buf))) > 0) {
-	    buf[sizeof(buf) - 1] = '\0';
+	    buf[n_read] = '\0';
 	    if (buf[strlen(buf) - 1] == '\n')
 		buf[strlen(buf) - 1] = '\0';
 	    debug_print("Version: %s\n", buf);
@@ -526,7 +526,7 @@ Clamd_Stat clamd_verify_email(const gchar* path, response* result) {
 		g_free(command);
 		memset(buf, '\0', sizeof(buf));
 		while ((n_read = read(sock, buf, BUFSIZ)) > 0) {
-			buf[sizeof(buf) - 1] = '\0';
+			buf[n_read] = '\0';
 			if (buf[strlen(buf) - 1] == '\n')
 				buf[strlen(buf) - 1] = '\0';
 		}

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list