git: 4ce9f853281d - main - x11-wm/xfce4-panel: Import upstream commit to fix crash

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Sat, 29 Apr 2023 16:02:11 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4ce9f853281de004da253d761a4ef81a0b427e7f

commit 4ce9f853281de004da253d761a4ef81a0b427e7f
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-04-29 15:51:00 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-04-29 15:51:00 +0000

    x11-wm/xfce4-panel: Import upstream commit to fix crash
    
    Reported by:    hselasky
    Obtained from:  https://gitlab.xfce.org/xfce/xfce4-panel/-/commit/3bf948cc2618632aaaaabefae1b1be50d5a607c3
---
 x11-wm/xfce4-panel/Makefile                       |  1 +
 x11-wm/xfce4-panel/files/patch-upstream-crash-fix | 50 +++++++++++++++++++++++
 2 files changed, 51 insertions(+)

diff --git a/x11-wm/xfce4-panel/Makefile b/x11-wm/xfce4-panel/Makefile
index f7b8c1a2aa52..797080a0eff5 100644
--- a/x11-wm/xfce4-panel/Makefile
+++ b/x11-wm/xfce4-panel/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	xfce4-panel
 PORTVERSION=	4.18.3
+PORTREVISION=	1
 CATEGORIES=	x11-wm xfce
 MASTER_SITES=	XFCE
 DIST_SUBDIR=	xfce4
diff --git a/x11-wm/xfce4-panel/files/patch-upstream-crash-fix b/x11-wm/xfce4-panel/files/patch-upstream-crash-fix
new file mode 100644
index 000000000000..160b26daa431
--- /dev/null
+++ b/x11-wm/xfce4-panel/files/patch-upstream-crash-fix
@@ -0,0 +1,50 @@
+From 3bf948cc2618632aaaaabefae1b1be50d5a607c3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ga=C3=ABl=20Bonithon?= <gael@xfce.org>
+Date: Sun, 16 Apr 2023 17:55:54 +0200
+Subject: [PATCH] tasklist: Fix use-after-free on tasklist child
+
+This was running smoothly since 2010 but the update to GLib 2.76, which
+makes g_slice_free() a simple wrapper around g_free_sized(), revealed
+this bug.
+
+Fixes: #730
+(cherry picked from commit a5a289ede6c2175b97059ead5d63a59dbde04ea0)
+---
+ plugins/tasklist/tasklist-widget.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/tasklist/tasklist-widget.c b/plugins/tasklist/tasklist-widget.c
+index 24dfdb7db..c0095d70d 100644
+--- plugins/tasklist/tasklist-widget.c
++++ plugins/tasklist/tasklist-widget.c
+@@ -1501,6 +1501,15 @@ xfce_tasklist_scroll_event (GtkWidget      *widget,
+ 
+ 
+ 
++static gboolean
++xfce_tasklist_free_child (gpointer data)
++{
++  g_slice_free (XfceTasklistChild, data);
++  return FALSE;
++}
++
++
++
+ static void
+ xfce_tasklist_remove (GtkContainer *container,
+                       GtkWidget    *widget)
+@@ -1528,7 +1537,10 @@ xfce_tasklist_remove (GtkContainer *container,
+           if (child->pixbuf != NULL)
+             g_object_unref (child->pixbuf);
+ 
+-          g_slice_free (XfceTasklistChild, child);
++          /* allow time for signal handlers connected to the destroy/dispose signals of
++           * child members to run, they could refer to these members via child, e.g.
++           * child->button as above to test for equality */
++          g_idle_add (xfce_tasklist_free_child, child);
+ 
+           /* queue a resize if needed */
+           if (G_LIKELY (was_visible))
+-- 
+GitLab
+