[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-223-g2e626bf17

wwp at claws-mail.org wwp at claws-mail.org
Sun Sep 26 19:43:14 CEST 2021


The branch, gtk3 has been updated
       via  2e626bf179777336beccb385b817465bf64c4a34 (commit)
      from  2365b058e7ac75afc82e06ad43ead42fdee0c98f (commit)

Summary of changes:
 src/summaryview.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)


- Log -----------------------------------------------------------------
commit 2e626bf179777336beccb385b817465bf64c4a34
Author: wwp <subscript at free.fr>
Date:   Sun Sep 26 19:41:22 2021 +0200

    Fix CID 1491116: explicit null dereference,
    make sure folder item identifier is set and further allocations are possible when building a path list.

diff --git a/src/summaryview.c b/src/summaryview.c
index ff7e6d917..208d11809 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -7607,24 +7607,28 @@ static void summary_drag_data_get(GtkWidget        *widget,
               path_list = folder_item_get_identifier(msginfo->folder);
 		}
 
-		for (cur = GTK_CMCLIST(ctree)->selection;
-		     cur != NULL && cur->data != NULL; cur = cur->next) {
-			gchar *tmp;
+		if (path_list != NULL) {
+			for (cur = GTK_CMCLIST(ctree)->selection;
+			     cur != NULL && cur->data != NULL && path_list != NULL; cur = cur->next) {
+				gchar *tmp;
 
-			msginfo = gtk_cmctree_node_get_row_data(ctree, GTK_CMCTREE_NODE(cur->data));
-            if(!msginfo)
-              continue;
-			tmp = path_list;
-			path_list = g_strconcat(path_list, "\n", (msginfo->msgid ? msginfo->msgid : "unknown"), NULL);
-			g_free(tmp);
-		}
+				msginfo = gtk_cmctree_node_get_row_data(ctree, GTK_CMCTREE_NODE(cur->data));
+				if(!msginfo)
+					continue;
+				tmp = path_list;
+				path_list = g_strconcat(path_list, "\n", (msginfo->msgid ? msginfo->msgid : "unknown"), NULL);
+				g_free(tmp);
+			}
 
-		if (path_list != NULL) {
-			gtk_selection_data_set(selection_data,
+			if (path_list != NULL) {
+				gtk_selection_data_set(selection_data,
 					       gtk_selection_data_get_target(selection_data), 8,
 					       path_list, strlen(path_list));
-			g_free(path_list);
-		}
+				g_free(path_list);
+			}
+		} else {
+			g_warning("summary_drag_data_get: no folder item identifier");
+		}        
     }
 }
 

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list