[Commits] [SCM] claws branch, master, updated. 4.3.0-45-g4ab583e27

mones at claws-mail.org mones at claws-mail.org
Wed Nov 13 18:28:46 UTC 2024


The branch, master has been updated
       via  4ab583e275576073a8831d55a8b7c6b4db1e5e3e (commit)
      from  2b61e4b2c77c80c0a91e11f81c58d41956a117de (commit)

Summary of changes:
 src/grouplistdialog.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


- Log -----------------------------------------------------------------
commit 4ab583e275576073a8831d55a8b7c6b4db1e5e3e
Author: Ricardo Mones <ricardo at mones.org>
Date:   Wed Nov 13 19:25:37 2024 +0100

    Fix bug 4840: core dump unsubscribing from newsgroups
    
    Thanks claws-mail at sjh.sh for the patch.

diff --git a/src/grouplistdialog.c b/src/grouplistdialog.c
index ef8ae22f8..ab54da12b 100644
--- a/src/grouplistdialog.c
+++ b/src/grouplistdialog.c
@@ -602,8 +602,14 @@ static gboolean button_press_cb(GtkCMCTree *ctree, GdkEventButton *button,
 	list = g_slist_find_custom(subscribed, ginfo->name,
 				   (GCompareFunc)g_ascii_strcasecmp);
 	if (list) {
+		/*
+		 * Make a copy so we can g_free() it after we remove
+		 * list from the subscribed list.  Calling g_free()
+		 * first triggers a use-after-free Coverity issue.
+		 */
+		gpointer tmpdata = list->data;
 		subscribed = g_slist_remove(subscribed, list->data);
-		g_free(list->data);
+		g_free(tmpdata);
 		gtk_cmclist_unselect_row(GTK_CMCLIST(ctree), row, 0);
 	} else {
 		subscribed = g_slist_append(subscribed, g_strdup(ginfo->name));

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list