[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/15: gnu: gtk+-2: Fix build by hardening list store.
From: |
guix-commits |
Subject: |
10/15: gnu: gtk+-2: Fix build by hardening list store. |
Date: |
Thu, 13 Apr 2023 01:12:05 -0400 (EDT) |
lilyp pushed a commit to branch gnome-team
in repository guix.
commit ffe8d95115918dae2be41a04587ca5c13c22b500
Author: Liliana Marie Prikler <liliana.prikler@gmail.com>
AuthorDate: Thu Mar 30 20:41:59 2023 +0200
gnu: gtk+-2: Fix build by hardening list store.
* gnu/packages/patches/gtk2-harden-list-store.patch: New file.
* gnu/packages/gtk.scm (gtk+-2)[patches]: Add it here.
* gnu/local.mk (dist_patch_DATA): Register it here.
---
gnu/local.mk | 1 +
gnu/packages/gtk.scm | 1 +
gnu/packages/patches/gtk2-harden-list-store.patch | 42 +++++++++++++++++++++++
3 files changed, 44 insertions(+)
diff --git a/gnu/local.mk b/gnu/local.mk
index 0f957e2191..4590508841 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1303,6 +1303,7 @@ dist_patch_DATA =
\
%D%/packages/patches/guile-rsvg-pkgconfig.patch \
%D%/packages/patches/guile-emacs-fix-configure.patch \
%D%/packages/patches/gtk2-fix-builder-test.patch \
+ %D%/packages/patches/gtk2-harden-list-store.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_PATH.patch \
%D%/packages/patches/gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch \
%D%/packages/patches/gtk2-theme-paths.patch \
diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm
index 3e57035bac..6d3bbb42be 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -1014,6 +1014,7 @@ is part of the GNOME accessibility project.")
"1nn6kks1zyvb5xikr9y2k7r9bwjy1g4b0m0s66532bclymbwfamc"))
(patches (search-patches "gtk2-respect-GUIX_GTK2_PATH.patch"
"gtk2-respect-GUIX_GTK2_IM_MODULE_FILE.patch"
+ "gtk2-harden-list-store.patch"
"gtk2-theme-paths.patch"
"gtk2-fix-builder-test.patch"))))
(build-system gnu-build-system)
diff --git a/gnu/packages/patches/gtk2-harden-list-store.patch
b/gnu/packages/patches/gtk2-harden-list-store.patch
new file mode 100644
index 0000000000..f49dc3bc77
--- /dev/null
+++ b/gnu/packages/patches/gtk2-harden-list-store.patch
@@ -0,0 +1,42 @@
+Backport the implementation of gtk_list_store_iter_is_valid from gtk+-3.
+
+Index: gtk+-2.24.33/gtk/gtkliststore.c
+===================================================================
+--- gtk+-2.24.33.orig/gtk/gtkliststore.c
++++ gtk+-2.24.33/gtk/gtkliststore.c
+@@ -1195,16 +1195,31 @@ gboolean
+ gtk_list_store_iter_is_valid (GtkListStore *list_store,
+ GtkTreeIter *iter)
+ {
++ GSequenceIter *seq_iter;
++
+ g_return_val_if_fail (GTK_IS_LIST_STORE (list_store), FALSE);
+ g_return_val_if_fail (iter != NULL, FALSE);
+
+- if (!VALID_ITER (iter, list_store))
+- return FALSE;
++ /* can't use VALID_ITER() here, because iter might point
++ * to random memory.
++ *
++ * We MUST NOT dereference it.
++ */
+
+- if (g_sequence_iter_get_sequence (iter->user_data) != list_store->seq)
++ if (iter == NULL ||
++ iter->user_data == NULL ||
++ list_store->stamp != iter->stamp)
+ return FALSE;
+
+- return TRUE;
++ for (seq_iter = g_sequence_get_begin_iter (list_store->seq);
++ !g_sequence_iter_is_end (seq_iter);
++ seq_iter = g_sequence_iter_next (seq_iter))
++ {
++ if (seq_iter == iter->user_data)
++ return TRUE;
++ }
++
++ return FALSE;
+ }
+
+ static gboolean real_gtk_list_store_row_draggable (GtkTreeDragSource
*drag_source,
- branch gnome-team updated (ac180c65e5 -> f81e71552f), guix-commits, 2023/04/13
- 03/15: gnu: Make pango-next the new pango., guix-commits, 2023/04/13
- 05/15: gnu: Make gobject-introspection-next the new gobject-introspection., guix-commits, 2023/04/13
- 10/15: gnu: gtk+-2: Fix build by hardening list store.,
guix-commits <=
- 14/15: gnu: inkscape: Use new package style., guix-commits, 2023/04/13
- 15/15: gnu: Remove lib2geom 1.1., guix-commits, 2023/04/13
- 09/15: gnu: python-pygobject: Update to 3.44.1., guix-commits, 2023/04/13
- 02/15: gnu: glib: Update to 2.76.1., guix-commits, 2023/04/13
- 06/15: gnu: gobject-introspection: Update to 1.76.1., guix-commits, 2023/04/13
- 08/15: gnu: python-pygobject: Set upstream-name., guix-commits, 2023/04/13
- 13/15: gnu: inkscape: Update stable version to 1.2.1., guix-commits, 2023/04/13
- 01/15: gnu: librsvg-2.40: Fix test failure with Pango 1.50., guix-commits, 2023/04/13
- 11/15: gnu: gtk+: Update to 3.24.37., guix-commits, 2023/04/13
- 04/15: gnu: pango: Update to 1.50.14., guix-commits, 2023/04/13