diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /extra/xfce4-xkb-plugin/crashfix.diff |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'extra/xfce4-xkb-plugin/crashfix.diff')
-rw-r--r-- | extra/xfce4-xkb-plugin/crashfix.diff | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/extra/xfce4-xkb-plugin/crashfix.diff b/extra/xfce4-xkb-plugin/crashfix.diff new file mode 100644 index 000000000..5ccfbaa3c --- /dev/null +++ b/extra/xfce4-xkb-plugin/crashfix.diff @@ -0,0 +1,34 @@ +From 52dc725bf5e44a0ab0064daebffe7ff139da0f78 Mon Sep 17 00:00:00 2001 +From: Lionel Le Folgoc <mrpouit@gmail.com> +Date: Fri, 24 Sep 2010 21:28:49 +0200 +Subject: Handle cases when the keyboard model is empty + +gtk_combo_box_get_active_iter () does not set the iter, and a call to +gtk_tree_model_get () using this iter will crash. Thus, check the return value +of gtk_combo_box_get_active_iter () before using the iter. +--- + panel-plugin/xkb-settings-dialog.c | 8 +++++--- + 1 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/panel-plugin/xkb-settings-dialog.c b/panel-plugin/xkb-settings-dialog.c +index 178ec5f..37a0a9a 100644 +--- a/panel-plugin/xkb-settings-dialog.c ++++ b/panel-plugin/xkb-settings-dialog.c +@@ -831,9 +831,11 @@ xkb_settings_update_from_ui (t_xkb *xkb) + gint i = 0; + + model = GTK_TREE_MODEL (xkb->combo_store); +- gtk_combo_box_get_active_iter (GTK_COMBO_BOX (xkb->kbd_model_combo), &iter); +- gtk_tree_model_get (model, &iter, NOM, &kbdmodel, -1); +- kbd_config->model = kbdmodel; ++ if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (xkb->kbd_model_combo), &iter)) ++ { ++ gtk_tree_model_get (model, &iter, NOM, &kbdmodel, -1); ++ kbd_config->model = kbdmodel; ++ } + + model = GTK_TREE_MODEL (xkb->toggle_options_store); + if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (xkb->toggle_options_combo), &iter)) +-- +1.7.1 + |