1 |
pacho 09/12/28 19:27:57 |
2 |
|
3 |
Added: gnome-control-center-2.26.0-keybinding-crash.patch |
4 |
Log: |
5 |
Fix gnome-keybinding-properties crash (bug 291507) |
6 |
(Portage version: 2.1.7.15/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 gnome-base/gnome-control-center/files/gnome-control-center-2.26.0-keybinding-crash.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/gnome-control-center/files/gnome-control-center-2.26.0-keybinding-crash.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/gnome-base/gnome-control-center/files/gnome-control-center-2.26.0-keybinding-crash.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: gnome-control-center-2.26.0-keybinding-crash.patch |
15 |
=================================================================== |
16 |
From 5998aa90c08051cc520dfb64ede78783ef9cc2c4 Mon Sep 17 00:00:00 2001 |
17 |
From: Jens Granseuer <jensgr@×××.net> |
18 |
Date: Tue, 11 Aug 2009 16:01:55 +0000 |
19 |
Subject: Fix crash when iterating through the tree model |
20 |
|
21 |
Don't use indices to move through iterators, don't skip the first |
22 |
section, and verify that we got a new iterator before using it |
23 |
(bug #591392). |
24 |
--- |
25 |
diff --git a/capplets/keybindings/gnome-keybinding-properties.c b/capplets/keybindings/gnome-keybinding-properties.c |
26 |
index fb3ba35..5383298 100644 |
27 |
--- a/capplets/keybindings/gnome-keybinding-properties.c |
28 |
+++ b/capplets/keybindings/gnome-keybinding-properties.c |
29 |
@@ -522,25 +522,20 @@ find_section (GtkTreeModel *model, |
30 |
GtkTreeIter *iter, |
31 |
const char *title) |
32 |
{ |
33 |
- gint i, j; |
34 |
- gboolean found; |
35 |
+ gboolean success, found; |
36 |
|
37 |
- i = gtk_tree_model_iter_n_children (model, NULL); |
38 |
found = FALSE; |
39 |
- gtk_tree_model_get_iter_first (model, iter); |
40 |
- for (j = 0; j < i; j++) |
41 |
+ success = gtk_tree_model_get_iter_first (model, iter); |
42 |
+ while (success && !found) |
43 |
{ |
44 |
char *description = NULL; |
45 |
|
46 |
- gtk_tree_model_iter_next (model, iter); |
47 |
gtk_tree_model_get (model, iter, |
48 |
DESCRIPTION_COLUMN, &description, |
49 |
-1); |
50 |
- if (g_strcmp0 (description, title) == 0) |
51 |
- { |
52 |
- found = TRUE; |
53 |
- break; |
54 |
- } |
55 |
+ |
56 |
+ found = (g_strcmp0 (description, title) == 0); |
57 |
+ success = gtk_tree_model_iter_next (model, iter); |
58 |
} |
59 |
if (!found) |
60 |
{ |
61 |
-- |
62 |
cgit v0.8.2 |