[Commits] [SCM] claws branch, master, updated. 3.10.0-55-g8e72254

Colin colin at claws-mail.org
Thu Jun 5 17:12:22 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  8e7225406c2fe85c01c65973d12d64372d935a59 (commit)
       via  f3ff9ce0822632b1574e2dac1fc8af156e76ceef (commit)
       via  45d1336418363e99adab9a2b7ef1232188b8b5b7 (commit)
       via  ed368582367b747252a352762b02f7c97ae6663c (commit)
       via  8a6b07b19452eaeec1acac69da499fef6c1106bc (commit)
       via  d2da356bdea282901f5f0d609f6b8c7c75bbf0c7 (commit)
       via  f7c66aa0fffa1e9ddc01c6844ed8486dbe6f0eb5 (commit)
       via  d2b07ae1062609916305cd23dff1b691c8550453 (commit)
       via  8bab691abc2150e2f047049a356347370223cfc4 (commit)
       via  834a78111238efb193c57e8c347660b63edbf1c3 (commit)
       via  2ce0c73c216e323a8500a59edfed8ab91284286d (commit)
       via  70322459db5caead77ec306bba1a669d42cc5020 (commit)
       via  67caebc662c705dc8dfcafc911a14d3f92609907 (commit)
      from  e6776707ace49e340f63bd14084029431ac5618e (commit)


- Log -----------------------------------------------------------------
commit 8e7225406c2fe85c01c65973d12d64372d935a59
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 17:12:18 2014 +0200

    Coverity fixes

diff --git a/src/addrindex.c b/src/addrindex.c
index da431b9..9cf4e54 100644
--- a/src/addrindex.c
+++ b/src/addrindex.c
@@ -2004,8 +2004,7 @@ static void addrindex_add_obj( XMLFile *file, AddressCvtNode *node ) {
 			node->list = g_list_append( node->list, newNode );
 		}
 		else {
-			/* g_print( "invalid: !!! \n" ); */
-			attr = xml_get_current_tag_attr( file );
+			g_warning("Invalid tag");
 		}
 	}
 }

commit f3ff9ce0822632b1574e2dac1fc8af156e76ceef
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 17:06:36 2014 +0200

    Coverity fixes

diff --git a/src/addrharvest.c b/src/addrharvest.c
index 4178f0e..d862eca 100644
--- a/src/addrharvest.c
+++ b/src/addrharvest.c
@@ -776,8 +776,8 @@ static void addrharvest_harvest_dir(
 	/* Process directory */
 	r = chdir( dir );
 	while( r == 0 && ( d = readdir( dp ) ) != NULL ) {
-		g_stat( d->d_name, &s );
-		if( S_ISDIR( s.st_mode ) ) {
+		gint sr = g_stat( d->d_name, &s );
+		if(sr == 0 &&  S_ISDIR( s.st_mode ) ) {
 			if( harvester->folderRecurse ) {
 				if( strstr( DIR_IGNORE, d->d_name ) != NULL )
 					continue;
@@ -785,7 +785,7 @@ static void addrharvest_harvest_dir(
 					harvester, cache, listHdr, d->d_name );
 			}
 		}
-		if( S_ISREG( s.st_mode ) ) {
+		if(sr == 0 && S_ISREG( s.st_mode ) ) {
 			if( ( num = to_number( d->d_name ) ) >= 0 ) {
 				addrharvest_readfile(
 					harvester, d->d_name, cache, listHdr );
@@ -820,6 +820,7 @@ static void addrharvest_harvest_list(
 	/* Process message list */
 	r = chdir( harvester->path );
 	if (r != 0) {
+		closedir( dp );
 		g_message("cannot chdir %s\n", harvester->path);
 		return;
 	}

commit 45d1336418363e99adab9a2b7ef1232188b8b5b7
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 17:06:28 2014 +0200

    Finish previous fix

diff --git a/src/plugins/mailmbox/mailimf_types_helper.c b/src/plugins/mailmbox/mailimf_types_helper.c
index 85e936c..384e7a6 100644
--- a/src/plugins/mailmbox/mailimf_types_helper.c
+++ b/src/plugins/mailmbox/mailimf_types_helper.c
@@ -278,7 +278,7 @@ static void detach_free_common_fields(struct mailimf_orig_date * imf_date,
   }
   if (imf_cc != NULL) {
     imf_cc->cc_addr_list = NULL;
-    mailimf_to_free(imf_cc);
+    mailimf_cc_free(imf_cc);
   }
   if (imf_bcc != NULL) {
     imf_bcc->bcc_addr_list = NULL;

commit ed368582367b747252a352762b02f7c97ae6663c
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 17:03:56 2014 +0200

    Coverity fixes

diff --git a/src/addressbook.c b/src/addressbook.c
index 31c633d..a516b92 100644
--- a/src/addressbook.c
+++ b/src/addressbook.c
@@ -1913,7 +1913,7 @@ static void addressbook_tree_selected(GtkCMCTree *ctree, GtkCMCTreeNode *node,
 		static gboolean tVal = TRUE;
 
 		ads = ADAPTER_DSOURCE(obj);
-		if( ads == NULL ) return;
+
 		ds = ads->dataSource;
 		if( ds == NULL ) return;		
 
@@ -2881,7 +2881,7 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
 
 	if( obj->type == ADDR_DATASOURCE ) {
 		ads = ADAPTER_DSOURCE(obj);
-		if( ads == NULL ) return;
+
 		ds = ads->dataSource;
 		if( ds == NULL ) return;
 	}
@@ -3242,7 +3242,7 @@ static void addressbook_new_address_cb( GtkAction *action, gpointer data ) {
 			folder = addressbook_setup_subf( ds, _("New Contacts"), parentNode );
 			if (!folder)
 				return;
-			pobj = gtk_cmctree_node_get_row_data(GTK_CMCTREE(addrbook.ctree), addrbook.treeSelected);
+
 			ds = addressbook_find_datasource( GTK_CMCTREE_NODE(addrbook.treeSelected) );
 			if (ds)
 				abf = ds->rawDataSource;
@@ -3400,7 +3400,6 @@ static void addressbook_edit_address( gpointer data, guint action, GtkWidget *wi
 
        	ctree = GTK_CMCTREE( addrbook.ctree );
 	pobj = gtk_cmctree_node_get_row_data( ctree, addrbook.treeSelected );
-	node = gtk_cmctree_find_by_row_data( ctree, addrbook.treeSelected, obj );
 
 	ds = addressbook_find_datasource( GTK_CMCTREE_NODE(addrbook.treeSelected) );
 	if( ds == NULL ) return;
@@ -3409,7 +3408,7 @@ static void addressbook_edit_address( gpointer data, guint action, GtkWidget *wi
 	
 	if( obj->type == ADDR_ITEM_EMAIL ) {
 		ItemEMail *email = ( ItemEMail * ) obj;
-		if( email == NULL ) return;
+
 		if( pobj && pobj->type == ADDR_ITEM_GROUP ) {
 			/* Edit parent group */
 			AdapterGroup *adapter = ADAPTER_GROUP(pobj);
@@ -4695,8 +4694,6 @@ static void addressbook_browse_entry_cb( GtkAction *action, gpointer data)
 	person = NULL;
 	if (obj->type == ADDR_ITEM_EMAIL) {
 		email = ( ItemEMail * ) obj;
-		if (email == NULL)
-			return;
 		
 		person = (ItemPerson *) ADDRITEM_PARENT(email);
 	}

commit 8a6b07b19452eaeec1acac69da499fef6c1106bc
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:58:01 2014 +0200

    Fix missing NULL checks

diff --git a/src/addressadd.c b/src/addressadd.c
index addf3f4..868dd9f 100644
--- a/src/addressadd.c
+++ b/src/addressadd.c
@@ -472,20 +472,23 @@ gboolean addressadd_selection(const gchar *name, const gchar *address,
 							returned_name, 
 							address, 
 							returned_remarks);
-			person->status = ADD_ENTRY;
-
-			if (picture) {
-				GError *error = NULL;
-				gchar *name = g_strconcat( get_rc_dir(), G_DIR_SEPARATOR_S, ADDRBOOK_DIR, G_DIR_SEPARATOR_S, 
-							ADDRITEM_ID(person), ".png", NULL );
-				gdk_pixbuf_save(picture, name, "png", &error, NULL);
-				if (error) {
-					g_warning(_("Failed to save image: \n%s"),
-							error->message);
-					g_error_free(error);
+			
+			if (person != NULL) {
+				person->status = ADD_ENTRY;
+
+				if (picture) {
+					GError *error = NULL;
+					gchar *name = g_strconcat( get_rc_dir(), G_DIR_SEPARATOR_S, ADDRBOOK_DIR, G_DIR_SEPARATOR_S, 
+								ADDRITEM_ID(person), ".png", NULL );
+					gdk_pixbuf_save(picture, name, "png", &error, NULL);
+					if (error) {
+						g_warning(_("Failed to save image: \n%s"),
+								error->message);
+						g_error_free(error);
+					}
+					addritem_person_set_picture( person, ADDRITEM_ID(person) ) ;
+					g_free( name );
 				}
-				addritem_person_set_picture( person, ADDRITEM_ID(person) ) ;
-				g_free( name );
 			}
 #else
 			ContactData* contact = g_new0(ContactData, 1);
@@ -524,7 +527,7 @@ gboolean addressadd_selection(const gchar *name, const gchar *address,
 			contact_data_free(&contact);
 #endif
 #ifdef USE_LDAP
-			if (fi->book->type == ADBOOKTYPE_LDAP) {
+			if (person != NULL && fi->book->type == ADBOOKTYPE_LDAP) {
 				LdapServer *server = (LdapServer *) fi->book;
 				ldapsvr_set_modified(server, TRUE);
 				ldapsvr_update_book(server, person);

commit d2da356bdea282901f5f0d609f6b8c7c75bbf0c7
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:55:26 2014 +0200

    Fix Coverity issues

diff --git a/src/addrcustomattr.c b/src/addrcustomattr.c
index f3b067f..46f769d 100644
--- a/src/addrcustomattr.c
+++ b/src/addrcustomattr.c
@@ -111,7 +111,7 @@ static gint custom_attr_cmp_func (GtkTreeModel *model, GtkTreeIter *a,
 		return name2 == NULL ? 0:1;
 	
 	if (name2 == NULL)
-		return name1 == NULL ? 0:1;
+		return 1;
 	
 	return g_utf8_collate(name1, name2);
 }
@@ -597,7 +597,6 @@ static void custom_attr_window_save_list (void)
 	g_list_free(prefs_common.addressbook_custom_attributes);
 
 	/* copy attribute names list from store to prefs */
-	store_to_glist = store_to_glist;
 	gtk_tree_model_foreach(gtk_tree_view_get_model
 			(GTK_TREE_VIEW(custom_attr_window.attr_list)), 
 			(GtkTreeModelForeachFunc) custom_attr_store_to_glist,

commit f7c66aa0fffa1e9ddc01c6844ed8486dbe6f0eb5
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:53:06 2014 +0200

    Fix g_stat return value unchecked

diff --git a/src/addrbook.c b/src/addrbook.c
index 8c2bec5..04e6c8c 100644
--- a/src/addrbook.c
+++ b/src/addrbook.c
@@ -1829,13 +1829,13 @@ GList *addrbook_get_bookfile_list(AddressBookFile *book) {
 
 	while( ( dir_name = g_dir_read_name( dir ) ) != NULL ) {
 		gchar *endptr = NULL;
-		gint i;
+		gint i, r;
 		gboolean flg;
 
 		strncpy(buf, adbookdir, WORK_BUFLEN);
 		strncat(buf, dir_name, WORK_BUFLEN - strlen(buf));
-		g_stat(buf, &statbuf);
-		if (S_ISREG(statbuf.st_mode)) {
+		r = g_stat(buf, &statbuf);
+		if (r == 0 && S_ISREG(statbuf.st_mode)) {
 			if (strncmp(
 				dir_name,
 				ADDRBOOK_PREFIX, lenpre) == 0)

commit d2b07ae1062609916305cd23dff1b691c8550453
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:50:51 2014 +0200

    Fix missing mutex accessing _displayQueue_

diff --git a/src/addr_compl.c b/src/addr_compl.c
index 104ce66..1d7d65d 100644
--- a/src/addr_compl.c
+++ b/src/addr_compl.c
@@ -1651,10 +1651,9 @@ void addrcompl_teardown( void ) {
 	/* g_print( "addrcompl_teardown...\n" ); */
 	addrcompl_free_window( _compWindow_ );
 	_compWindow_ = NULL;
-	if( _displayQueue_ ) {
-		g_list_free( _displayQueue_ );
-	}
-	_displayQueue_ = NULL;
+
+	addrcompl_clear_queue();
+
 	_completionIdleID_ = 0;
 	/* g_print( "addrcompl_teardown...done\n" ); */
 }

commit 8bab691abc2150e2f047049a356347370223cfc4
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:50:42 2014 +0200

    Fix off-by-one

diff --git a/src/account.c b/src/account.c
index a90f370..f1eeeb1 100644
--- a/src/account.c
+++ b/src/account.c
@@ -210,7 +210,7 @@ void account_read_config_all(void)
 	while (fgets(buf, sizeof(buf), fp) != NULL) {
 		if (!strncmp(buf, "[Account: ", 10)) {
 			strretchomp(buf);
-			memmove(buf, buf + 1, strlen(buf));
+			memmove(buf, buf + 1, strlen(buf) - 1);
 			buf[strlen(buf) - 1] = '\0';
 			debug_print("Found label: %s\n", buf);
 			ac_label_list = g_slist_append(ac_label_list,

commit 834a78111238efb193c57e8c347660b63edbf1c3
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:43:36 2014 +0200

    Another wrong free

diff --git a/src/plugins/mailmbox/mailimf_types_helper.c b/src/plugins/mailmbox/mailimf_types_helper.c
index fa09d25..85e936c 100644
--- a/src/plugins/mailmbox/mailimf_types_helper.c
+++ b/src/plugins/mailmbox/mailimf_types_helper.c
@@ -278,7 +278,7 @@ static void detach_free_common_fields(struct mailimf_orig_date * imf_date,
   }
   if (imf_cc != NULL) {
     imf_cc->cc_addr_list = NULL;
-    mailimf_to_free(imf_to);
+    mailimf_to_free(imf_cc);
   }
   if (imf_bcc != NULL) {
     imf_bcc->bcc_addr_list = NULL;

commit 2ce0c73c216e323a8500a59edfed8ab91284286d
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:41:10 2014 +0200

    Fix another use-after-free

diff --git a/src/plugins/mailmbox/mailimf_types_helper.c b/src/plugins/mailmbox/mailimf_types_helper.c
index 66dce6b..fa09d25 100644
--- a/src/plugins/mailmbox/mailimf_types_helper.c
+++ b/src/plugins/mailmbox/mailimf_types_helper.c
@@ -1150,7 +1150,6 @@ int mailimf_fields_add_data(struct mailimf_fields * fields,
  free_field:
   if (field != NULL) {
     detach_field(field);
-    mailimf_field_free(field);
   }
  free:
   detach_free_fields(imf_date,

commit 70322459db5caead77ec306bba1a669d42cc5020
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:40:17 2014 +0200

    Don't close FILE we don't own

diff --git a/src/plugins/tnef_parse/tnef_dump.c b/src/plugins/tnef_parse/tnef_dump.c
index cee1572..15b8c99 100644
--- a/src/plugins/tnef_parse/tnef_dump.c
+++ b/src/plugins/tnef_parse/tnef_dump.c
@@ -675,7 +675,7 @@ gboolean SaveVTask(FILE *fptr, TNEFStruct TNEF) {
         }
         fprintf(fptr, "END:VTODO\n");
         fprintf(fptr, "END:VCALENDAR\n");
-        fclose(fptr);
+
         return TRUE;
 }
 

commit 67caebc662c705dc8dfcafc911a14d3f92609907
Author: Colin Leroy <colin at colino.net>
Date:   Thu Jun 5 16:39:12 2014 +0200

    Fix use after free

diff --git a/src/plugins/mailmbox/mailimf_types_helper.c b/src/plugins/mailmbox/mailimf_types_helper.c
index 9a7146f..66dce6b 100644
--- a/src/plugins/mailmbox/mailimf_types_helper.c
+++ b/src/plugins/mailmbox/mailimf_types_helper.c
@@ -568,7 +568,6 @@ mailimf_resent_fields_add_data(struct mailimf_fields * fields,
  free_field:
   if (field != NULL) {
     detach_resent_field(field);
-    mailimf_field_free(field);
   }
  free:
   detach_free_common_fields(imf_resent_date,

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

Summary of changes:
 src/account.c                               |    2 +-
 src/addr_compl.c                            |    7 +++---
 src/addrbook.c                              |    6 +++---
 src/addrcustomattr.c                        |    3 +--
 src/addressadd.c                            |   31 +++++++++++++++------------
 src/addressbook.c                           |   11 ++++------
 src/addrharvest.c                           |    7 +++---
 src/addrindex.c                             |    3 +--
 src/plugins/mailmbox/mailimf_types_helper.c |    4 +---
 src/plugins/tnef_parse/tnef_dump.c          |    2 +-
 10 files changed, 36 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list